SSH Transfers Between Servers: Summary

SSH is a unix tool you can use to facilitate secure and fast transfers between servers, or between your desktop and a server. Instead of transferring a file from server A to your PC and then from your PC to server B, you can more directly transfer files from Server A to server B.

You will need SSH credentials for both servers. These credentials include an ID, the server name, port and a password. You will need to get these from your server admin, or your ISP. Once you have these, start a terminal each and “SSH id@servername”. You will be prompted for a password. Once you login your terminal prompt will change, showing you that you’re on a different server. Keep both open. From the receiving server you can do the scp command. This seems the easiest.

Transfer files from ServerA to ServerB
I used Filezilla to show me the directory structure of both servers, and not for the transfer. Filezilla has a gui and shows you your directory tree. You should also use a text editor to write your commands and document successful transfers. Use a Terminal and log into the root of serverB.

There are a lot of long and boring videos online. Computer people can be very verbose. Both these videos are precise and short. Why watch some tech guy go on for 10 minutes when he could have done it it 2?

How to: Transfer files over SSH – YouTube 5’07”, best
How to copy files and folders from one server to another – YouTube 10’20” partly unix, partly windows

scp -r -P 1234 id@serverA:public_html/file-to-transfer file-to-receive

The -r means recursion, or to transfer all directories and files within. The -P is the port name.

Transfer files from your Desktop to ServerA
Start a terminal.

scp -r file-to-transfer id@serverA:public_html/file-to-receive

Slashes are quite important for the transfer. If you are transferring a directory you’ll need the ending “/”.

Transfer files from ServerA to your computer
Start a terminal. You’ll need to know the serverA ssh credentials. Short video

scp -r -P 1234 id@serverA:wantedfilesdir/ /dos/data/

Slashes are quite important for the transfer. If you are transferring a directory you’ll need the ending “/”.

Leave a Reply

Your email address will not be published. Required fields are marked *