Ubuntu

Copy files remotely using SCP in Ubuntu

SCP or Secure Copy is used for securely transferring files between a local and a remote host or between two remote hosts.  SCP is similar to RCP in many ways. RCP is also an important tool or command in Unix/Linux based systems for transferring files remotely.
But SCP has much-improved security.

During file transfer, data is encrypted in the case of SCP which is not the case with RCP. Thus SCP essentially protects the users from potential packet sniffers. SCP protocol itself doesn’t provide these features, but the underlying SSH does the trick.

  • Take a look on how to remote login using SSH in ubuntu
  • Using SCP you could copy files remotely. Following is the general syntax.

              scp  <file> <username>@<IP address or hostname>:<Destination>

  • Here are some examples.

           Let’s say user ‘me’ has to send the file with the name test to the user ‘you’, while being in me’s account.

                scp test you@192.168.1.1:

  • The default destination is /home/you here. Unless you specify otherwise file will be copied on to the default location as in the example above. If you want to specify the location, the following example will help you.

               scp test you@192.168.1.1:/home/you/directory

Related Articles

Leave a Reply

Back to top button