Why you should be using scp…

Wed, August 21st 2002

What is scp?

Scp (secure copy) is a program that is part of the ssh (secure shell) package and is used to securely copy data from, to or between remote computers. All data transferred via scp is encrypted, including your user name and password. If you run OS X, you already have it on your machine, just fire up terminal and go. If you are on another Unix or Linux, you may need to install it.

Why should I be using scp?

The only people who ask this question are those who don’t realize just how easy it is to “eavesdrop” on other people’s computer connections. Suffice to say, it is extremely easy to do and you should be worried. If you are set on using ftp to transfer your files you can use sftp which is also part of the ssh package. Scp isn’t necicarily a replacement for ftp (although it certainly can be) but it can be less cumbersome in many applications (such as quickly uploading a file).

How does it work?

Simple. Invoke the program, tell it what you want to copy and then where you want to copy it. Eg.

Example 1

scp ~/myFile.txt username@myserver.com:~/path

Here we are copying a local file named “myFile.txt” to a remote server with a user name “username” on the remote server “myserver.com” in the folder “~/path”. The two important things to note here are the “@” and “:” characters. The “@” specifies this user account residing “at” this server name. The “:” specifies that everything here after is to be considered the path to where you want this copied. Scp will not work without these characters and you will get errors.

Example 2

scp -r username@myserver.com:~/picturesFolder /tmp

Here, we use the “-r” option to copy an entire folder recursively. In this instance, the folder we are copying is a remote file on a server named “myserver”.

Scp is an easy and safe way to transfer files and folders and you should be using it whenever possible. For more information, check the scp manpage.





No Comments »

RSS feed for comments on this post.

Leave a comment

*