Linux/scp: Difference between revisions
< Linux
Line 1: | Line 1: | ||
== Install == | |||
# Install in docker | |||
apt install openssh-client | |||
== Recursive == | == Recursive == | ||
Latest revision as of 22:40, 23 March 2024
Install
# Install in docker apt install openssh-client
Recursive
scp -r local_path kenneth@remote_host:~/
Port
scp -P 9999 local_path kenneth@remote_host:~/
Copy path with spaces
scp -r myserver.com:"/path/with/a/Space\\ In\\ It" ./
scp -r myserver.com:"\"/path/with/a/Space In It\"" ./
scp kenneth@remote_host:"/my iso/en_ws_2003_ent_x64_vl.iso" .
References:
sshpass
# password in history: sshpass -p "password" scp -r user@example.com:/some/remote/path /some/local/path
# password not in bash history: sshpass -f "/path/to/passwordfile" scp -r user@example.com:/some/remote/path /some/local/path
ref: [1]