Categories
SCP Examples / hosaka: 13:46 04/01/2020 /

A quick reference for copying files over SSH using the Linux utility scp

Local (file) to remote host specifying remote port: scp -P 1337 file.zip username@remotehost.com:/remote/dir/file.zip

Local (directory) to remote host using default port 22: scp /local/dir/ username@remotehost.com:/remote/dir/

Remote host A to remote host B: scp username@host-a.com:/host_a/dir/file.zip username@host-b.com:/host_b/dir/file.zip