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 Користувачі, які знайшли це корисним