Copy files from server to server using SCP

Often times with a VPS or Dedicated Server you will need the ability to copy a single file or even an entire directory to another server.  You can use FTP just like you normally would when uploading files to the server, but you can go one step better with SCP (Secure Copy Program).

If you wanted to copy a single file from one server to another server you issue the following command;

scp myfile.tar root@newserverip:/your/directory/

If you wanted to copy an entire folder you can run this command;

scp -r myfolder root@newserverip:/your/directory/

With SCP you will be asked for the password to the new server (unless you've already setup authentication keys).  You can also requst files TO a server from the destination server.  As always, the simple command from shell is "man scp" and it'll bring up the entire manual with the various options you can use such as changing ports to shell in under etc.

Shell/Telnet must be enabled on the server in order to use SCP.

reviewed: 10/17/2016

  • Email, SSL
  • 34 Users Found This Useful
Was this answer helpful?

Related Articles

How do I find my root password?

1) Log into your billing account: 2) Click on the...

How to generate a CSR in WHM

You would like to purchase or transfer an SSL certificate but need a CSR to do so. Here's how to...

Changing ip addresses

To move an account from one ip to another in WHM:1) Log into WHM using root login details....

-DELETE How to downgrade MySQL from Version 5 to Version 4

If you've upgraded your MySQL Software to the newest version but for whatever reason need to...

How to disable Recursive DNS Lookups

A very common PCI Issue is related to the DNS servers.  In order to be PCI Compliant you must...