SCP Like a Boss
·
How to send and retrieve Files with SCP
Basics
scp copies files over a secure, encrypted network connection. scp stands for “secure copy.” If you are familiar with using the cp command on your local machine, scp is easy to understand.
Send file to Remote :
scp ~/my_local_file.txt [...] user@remote_host.com:/pathToRemoteDirectory
Send file across 2 remote hosts
scp user1@remotehost1:/some/remote/dir/foobar.txt user2@remotehost2:/some/remote/dir/
Retrieve file from Remote :
scp user@remote_host.com:/pathToRemoteDirectory/remotefile ~/my_local_file.txt
Directory
scp -r user@remote_host.com:/pathToRemoteDirectory/remotefile ~/my_local_file.txt
Options
Port Options
scp -P 2200
Verbose Options
scp -v
Bandwith Options
limit 400
scp rC -l 400
Ssh Options
identity file
scp -i private_key.pem
ssh_config
scp -F /home/user/my_ssh_config
Quiet mode Options
scp -q