How to Transfer Files in SSH from Another Server

Migrating your files from other servers to another hosting or cloud provider is a long process. But if both of your servers have SSH access, you can transfer these files at an instant using the speed bandwidth of your hosting or cloud provider.

Table of Contents

  1. Receiving Files from Another Server to Your Server
  2. Sending Files from Your Server to Another Server

It’s very simple to transfer files, all you have to do is to use the Secure File Copy command available in the SSH.

Receiving Files from Another Server to Your Server

To transfer files from another server, you just need to fire up these commands.

scp -r root@YOUR_OTHER_SERVER_IP_ADDRESS:/var/www/sample_directory /var/www/sample_newdirectory

The scp -r will copy all files inside the folder in root@YOUR_ANOTHER_SERVER:/var/www/sample_directory and pasted it to your server at /var/www/sample_newdirectory

Sending Files from Your Server to Another Server

If you want it vise versa, or would like to transfer your files to a remote server or another server. All you have to do is to interchange the command.

scp - r /var/www/sample_newdirectory root@YOUR_OTHER_SERVER_IP_ADDRESS:/var/www/sample_directory 

All of the command above will prompt you for a password for the SSH server. That’s it!

Leave a Comment

trabzon escort yalova escort Samsun escort izmit escort nazilli escort