Examples of how to use Secure Copy (scp)

scp uses ssh for data file transfer between servers and provides the same level of security as ssh.

Secure copy the file “somefile.txt” from a remote host to your local host

$ scp /your/local/directory


Secure Copy your file “somefile.txt” from the local host to a remote host

$ scp somefile.txt


Secure Copy the directory “localfoo” from your local host to a remote host’s directory “foobar”

$ scp -r localfoo


Copy the file “foobar.dat” from remote host “” to remote host “”

$ scp \


Copying the files “foo.dat” and “bar.dat” from yor localhost to your home directory on the remote host

$ scp foo.dat bar.dat


Copy the file “foobar.txt” from the local host to a remote host using port 2264

$ scp -P 2264 foobar.txt


Copy multiple files from remote to your current directory on the local host

$ scp\{a,b,c\} .


$ scp\{foo.txt,bar.txt\} .


Managing scp Performance

scp uses the Triple-DES cipher to encrypt the data being sent by default. By using Blowfish, as a cipher you may increase speed. Here is how.

$ scp -c blowfish some_file

If you have a slow connection you can use the -C option for compression to increase speed. If your connection is not slow, then this is not very helpful as it ads to the CPU burden.

$ scp -c blowfish -C local_file


Leave a Reply

Your email address will not be published. Required fields are marked *