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.

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

Adding a range/block of ips

As an example to add a /24 253 ips to a linux server follow these setups. We'll use...

How can I check my hard disk usage in Linux?

Once you are connected to the server via SSH, run the following command:# df -hThis will output...

Test If Linux Server SCSI / SATA Hard Disk Going Bad

One of our regular sends us a question: How can I test if my hard disk is going bad? I see few...

How to Find Out Hard Disk Specs / Details on Linux

Linux comes with various commands to find out information about your hard drive. I recommend...

Monitoring Hard Drive Health on Linux with smartmontools

S.M.A.R.T. is a system in modern hard drives designed to report conditions that may indicate...

Powered by WHMCompleteSolution