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 transeffering files remotely.
But SCP has a 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.

  • Using SCP you could copy files remotely. Following is the general syntax.

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

  • Here are some examples.

           Lets say user 'me' has to send the file with name test to the user 'you', while being in the 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 location, the following example will help you.

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

Content Courtesy: http://www.ubuntuguide.org
Content License:http://www.gnu.org/copyleft/fdl.htm

No votes yet
SCP

How do you copy a file that has spaces? For example: "this is the name of my file.avi"
Puting quotes around the name does not work

hi,

       You have to put forward slash( \ ) after each word in the file name and use tab afterwards. Each word is followed with a "\" and a space. Consider the following example.

                      scp Press\ Release\ Ml username@ip:/home/server

Here, Press Release Ml is the file name. Hope i made it clear for you :-)

Thank you
Manuel Jose
www.ubuntumanual.org