This is a quick guide for people that do not know you can also transfer files over SSH connection to/from a server with SFTP. SFTP is a protocol that works over SSH/Secure Shell connections. I am using Windows 10 locally and want to transfer files to/from my Linux servers.
This is a quick guide for people that do not know you can also transfer files over SSH connection to/from a server with SFTP. SFTP is a protocol that works over SSH/Secure Shell connections. I am using Windows 10 locally and want to transfer files to/from my Linux servers. In the past I have setup plain FTP servers but I do not set them up any longer.
I have setup servers on UpCloud using this guide to setup servers with SSH. I recently blogged about using PHP Storm to transfer files over SFTP but how can I do it outside PHP Storm. I have an older guide on how to do this with the Forklift program on OSX.
Go to https://winscp.net/eng/index.php and download and setup WinSCP.
Ensure you have a working connection to your server over a SSH first.
I connected to my server and compressed a folder ready to transfer over SFTP.
sudo zip -r /17-apr-2019-www.zip /wwwroot/
I now had a 1.8 gigabyte file to download over SFTP.
Setting up a Connection in WinSCP
You will see a window that will allow you to add a server server connection
Add your server name and port for SSH, also ad your SSH username. I wont add a ‘password as I login with SSH keys (not passwords)
Click on Advanced then Advanced to set more options like private keys.
Enter the path to your SSH private Key
It is a good idea to set folders and to remember the last directory used.
Save the connection
Now you will have a quick access shortcut to your server.
Connecting to your Server
I have a passphrase setup for my Private key so I need to enter that on each connection.
I have 2FA hardware one Time Passwords setup at login (read here) and WinSCP asks me for this passphrase. Nice.
Now I can see my remote server as if it was a local drive.
Download a file
I downloaded the backup file created earlier by dragging from the remote server window to my local computer window).
Downloads were not fast (about 1.5MB/s on a 50 megabyte connection.
Enable Right Click Shell Integrations
It is a good idea to enable right shell extensions in Windows Explorer to upload a file via SFTP.
Select Options and Preferences once you connect to a server.
Click Add upload shortcut to Explorer’s ‘Sent To’context menu.
Now when you right click on a file in Windows Explorer you can sent it to a server.
You will be asked by WinSCP what server to connect to, Select it and click Login.
An upload progress bar will appear. When the upload done the WinSCP will disconnect
Editing files in WinSCP
WinSCP is also good at editing files in WinSCP or using your preferred editor.
I hope this guide helps someone. Apologies if you already know this.
v1.0 Inital Post
This is a quick guide that will show you how you can connect to a cloud server via SFTP with the PHPStorm IDE from Jet Brians and deploy files from your localhost to the cloud
I have blogged about http://c9.io before and how it makes managing a remote Ubuntu server easier. Recently AWS acquired C9 and integrated it into AWS. This has triggered me to find a more open/free way to connect to my servers. I like AWS but I can tell that C9 will someday block you from talking to non-AWS servers.
C9 on AWS: https://aws.amazon.com/cloud9/?origin=c9io
C9 Aquisition: https://c9.io/announcement
I have blogged about connecting to an AWS EC2 instance with C9 (before AWS acquired C9), The quickest way to set up a scalable development IDE and web server when I was using Digital Ocean Servers, How to buy a new domain (dedicated server from digital ocean) and add an SSL certificate from NameCheap but when I moved to Vultr serves I decided to ditch C9 and save $9 a month. I got used to setting up an SSH connection, using rmate to edit remote files locally with Sublime and SSH’ing into the box with vSSH on OSX but nothing replaced the C9 file management experience.
C9 was a good IDE (but recent price hikes and AWS purchase have made me cautious).
Uploading files without C9 to Ubuntu
Uploading files from an OSX laptop to a remote Ubuntu server is possible with the SCP command
scp ~/Desktop/FilesToUpload.zip [email protected] /www/FilesToUpload.zip < # Enter the remote server password
Server Actions (to upload the old way, with scp)
#Install Unzip (if you do not have it) sudo apt-get install unzip # Unzip the file cd /www/ unzip /www/FilesToUpload.zip
There has to be a better way
I have used the Forklift 3 program before (my review here) and in recent google searches, it was suggested that Forklift best SFTP program on OSX. Yay. This unix.stackexchange.com thread mentions the difference between SFTP and SSH.
Setting up an SFTP Connection in Forklift 3
Read my Forklift 3 guide here first.
Update your Forklift to the latest version.
Add a Favorite in Forklift 3
Name the connection
In Forklift edit the connection
Specify SFTP and your servers working SSH username and password, and “/” folders
Double Click the entry to connect to your server.
To upload or download files with Forklift over SFTP, simply drag and drop.
You can now use Forklift to navigate folders, delete files, set remote file permissions all from a GUI. You can still use SSH CLI and or Sublime.
Quik Edit works too.
Nice, this gives me a convenient GUI way to upload, download and edit files instead of via CSP/SSH/CLI.
Now is there an SFTP plugin for Sublime?
More to come soon.
Donate and make this blog better
Ask a question or recommend an article
v1.0 Initial Draft