Linux/scp

From Omnia
Jump to navigation Jump to search

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]