Secure copy files on VPS or dedicated server with SCP

Most of the time if you are using a VPS hosting server or own dedicated server you will need to copy a single file, group of files or whole folder to another remove VPS or dedicated server. You can use the old good one FTP way just when uploading files to the remote server. But there is a lot easier and secure way to transfer files between servers with SCP (Secure Copy Program).

When you like to copy a single file from one VPS or dedicated server to another one you can use the following SSH command:

scp file.tar root@newserver:/your/directory/

To copy a whole folder between servers you can run the following SSH command:

scp -r folder root@newserver:/your/directory/

When using SCP the server will ask you for the password for the username on the new VPS hosting server or dedicated server (unless you have setup trust between servers with authentication keys). If you like to see all of the command options from shell just type "man scp" in the VPS or dedicated server SSH console. This SSH command will show you the SCP manual with all options you can use like changing server ports and more SCP parameters.

To use SCP you need to have on your VPS hosting server or dedicated server Shell (SSH) access enabled.

  • 69 Users Found This Useful
Was this answer helpful?

Related Articles

Change of the reverse DNS record for VPS hosting and dedicated server

To change the reverse DNS record for IP address, you’ll need to contact the support department in...

Checking of open connections

If you want to see the open connections to port 25 on your virtual private server or dedicated...

Do I have full root access to my VPS

Yes you do. With virtual hosting (VPS) you get root password for access, trough which you have...

Do I have my own IP address with my virtual server

Yes you do. We provide your own IP address to each virtual private server. If you need more than...

How to create .tar.gz archive

Creating .tar.gz archive can be done with one command. Use the following: tar -pczf...