Using SCP Command in DigitalOcean Server - All about it ?

DigitalOcean

SCP (Secure Copy) is a command line tool for Linux systems for securely transferring files from a remote server to the local system or vice versa. SCP uses SSH protocol for transferring files between two systems which is more secure than FTP.
With SCP command in DigitalOcean, files can be easily transferred.
Here at Fixwebnode, we shall look into how to use scp command to transfer files in your DigitalOcean Droplet server.
 

How to use SCP in your DigitalOcean droplet ?

Secure Copy Protocol or SCP runs on CLI via the scp command with the help of SSH for data transfer. The SCP command also has several additional options that specify hosts, authentication parameters as well as ports.
By default, the SCP protocol runs on port 22.
It takes the below command query:
$ scp [OPTIONS] [SOURCE] [DESTINATION]
Also, with the scp command, it is possible to move several files on the DigitalOcean server. However, both the droplets have to be in the same region for the process to succeed.
The follow steps should be taken to move several files using the scp command:
1. To begin with, we have to enable the private network for the droplets.
2. Then, we have to enable eth1 for both the droplets.
3. Next, run the following command to copy files from the source server to the destinations server:
$ scp -r /srv/users/serverpilot/apps/XXX/public/resources root@10.12.13.10:/srv/users/serverpilot/apps/XXX/public
Here, 10.12.13.10 is the private IP address of the destination server. We can identify this via the DigitalOcean admin area under settings, Alternatively, we can run ifconfig via SSH as well.
Also, we can transfer files over SSH with the SCP DigitalOcean command:
$ scp -r /folder1/folder2//myfiles root@0.0.0.0:/path/on/remote/droplet
Make sure you replace 0.0.0.0 with the droplet's IP address. We also have to update the paths as per our requirements.
If we want to transfer files to a different port, we have to use the -P flag as seen below:
$ scp -P 2222 -r /folder1/folder2/myfiles root@0.0.0.0:/path/on/remote/droplet
 

[Need help in fixing Ubuntu Linux server issues ? We can help you. ]

 


Your Cart