All for Joomla All for Webmasters

Linux SCP | What is Secure Copy


What is Secure Copy?

Secure Copy (scp) allows files to be copied to, from, or between different nodes. It uses ssh for data transfer and provides the same authentication and same level of security as ssh.

Examples

1. Copy the file “test.txt” from a remote host to the local host

$ scp your_username@remotehost.org:test.txt /some/local/directory

 

2. Copy the file “test.txt” from the local host to a remote host

$ scp test.txt your_username@remotehost.org:/some/remote/directory

 

3. Copy the directory “test” from the local host to a remote host’s directory “data”

$ scp -r test your_username@remotehost.org:/some/remote/directory/data

 

4. Copy the file “test.txt” from remote host “ubuntu1.org” to remote host “ubuntu2.org”

$ scp your_username@ubuntu1.edu:/some/remote/directory/test.txt \
your_username@ubuntu2.edu:/some/remote/directory/

 

5. Copying the files “test.txt” and “test1.txt” from the local host to your home directory on the remote host

$ scp test.txt test1.txt your_username@remotehost.org:~

 

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

$ scp -P 2264 test.txt your_username@remotehost.org:/some/remote/directory

 

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

$ scp your_username@remotehost.org:/some/remote/directory/\{a,b,c\} .
$ scp your_username@remotehost.org:~/\{test.txt,test1.txt\}

 

Secure Copy (scp) Performance

8. By default Secure Copy (scp) uses the Triple-DES cipher to encrypt the data being sent. Using the Blowfish cipher has been shown to increase speed. This can be done by using option -c blowfish in the command line.

$ scp -c blowfish some_file your_username@remotehost.org:~

 

9. It is often suggested that the -C option for compression should also be used to maximize the speed. The effect of compression, however, will only significantly maximize the speed if your connection is very slow. Otherwise it may just be adding extra burden to the processor. An example of using compression and blowfish:

$ scp -c blowfish -C local_file your_username@remotehost.org:~

 

Linux SCP | What is Secure Copy

log in

Become a part of our community!

reset password

Back to
log in
Choose A Format
Personality quiz
Trivia quiz
Poll
Story
List
Meme
Video
Audio
Image