Send and Retrieve Files via SSH with SCP - Earvin Kayonga’s Tech Blog

Earvin Kayonga Rwogera EarvinKayonga, a Software Engineering Student

Simple Blog

Send and Retrieve Files via SSH with SCP

August 31, 2016    Linux SSH

Basics

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

For more explanations:


By Earvin Kayonga