How Do I Transfer Files from One Linux Server to Another Using Scp?
Contents

To copy a directory (and all the files it contains), use scp with the -r option. This tells scp to recursively copy the source directory and its contents. You’ll be prompted for your password on the source system ( deathstar.com ). The command won’t work unless you enter the correct password.

How do I copy a file from one Linux server to another Linux server?

If you administer enough Linux servers you are probably familiar with transferring files between machines, with the help of the SSH command scp. The process is simple: You log into the server containing the file to be copied. You copy the file in question with the command scp FILE [email protected]_IP:/DIRECTORY.

How do I scp multiple files from one server to another?

16 Answers. You can copy whole directories with using -r switch so if you can isolate your files into own directory, you can copy everything at once. As Jiri mentioned, you can use scp -r [email protected]:/some/remote/path /some/local/path to copy files recursively.

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest