Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two servers, access to SSH on both. I want to transfer entire directory from server A to server B. They are both remote servers to me.

Am I right to assume it is possible to log into SSH terminal on my local PC, connect to server A, and do some magical command that will initiate a transfer between the two servers while being able to log out of terminal on my own local machine?

share|improve this question

migrated from Jun 15 '13 at 23:28

This question came from our site for system and network administrators.

Please search for rsync and scp - this question has been answered thousands of time on all kind of sites. – Sven Jun 15 '13 at 14:41

On server A:

$ scp -r /path/to/directory someuser@serverB:/path/to/files/.

The above command will copy the files from serverA to serverB using someuser (a user on serverB). The directory (/path/to/directory) will be copied as a directory to the directory on serverB into the directory /path/to/files/.

share|improve this answer
And if you want to log out before the transfer is finished, look into the "screen" command - you can start a screen, start the scp (or rsync) command, and then detach (ctrl+a, ctrl+d) and log out, while everything keeps running remotely inside the screen session. – faffaffaff Jun 19 '13 at 22:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.