Trasferire files con scp in multihop: Difference between revisions
Jump to navigation
Jump to search
Created page with "Se vogliamo trasferire un file via scp, ed i file si trova su una macchina raggiingibile solo dopo aver fatto ssh in un altra, ad esempio: noi ----> machineA ---> machineB (m..." |
mNo edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 2: | Line 2: | ||
noi ----> machineA ---> machineB (myfile.zip) | noi ----> machineA ---> machineB (myfile.zip) | ||
=Con rsync= | |||
rsync --progress -av --append --partial -e 'ssh -A -J machineA' machineB/myfile.zip . | |||
=Con Jumphost= | |||
scp -o 'ProxyJump machineA' machineB:/myfile.zip . | |||
=Vecchio modo = | |||
noi# ssh -t machineA ssh machineB | noi# ssh -t machineA ssh machineB | ||
| Line 8: | Line 17: | ||
"ProxyCommand ssh -q machineA nc -q0 %h 22" \ | "ProxyCommand ssh -q machineA nc -q0 %h 22" \ | ||
machineB:mysfile.zip . | machineB:mysfile.zip . | ||
=Riferimenti= | |||
*[https://www.madboa.com/blog/2017/11/02/ssh-proxyjump/ Using ProxyJump with SSH and SCP] | |||
*[https://mperdikeas.github.io/networking.html.files/scp-a-file-through-jump-host.html google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwiX8N-Iy4ryAhUPPuwKHYzmBL4QFjAAegQIBRAD&url=https%3A%2F%2Fmperdikeas.github.io%2Fnetworking.html.files%2Fscp-a-file-through-jump-host.html&usg=AOvVaw3vwxqCDstvOk8znmpln3O5] | |||
Latest revision as of 15:49, 5 August 2021
Se vogliamo trasferire un file via scp, ed i file si trova su una macchina raggiingibile solo dopo aver fatto ssh in un altra, ad esempio:
noi ----> machineA ---> machineB (myfile.zip)
Con rsync
rsync --progress -av --append --partial -e 'ssh -A -J machineA' machineB/myfile.zip .
Con Jumphost
scp -o 'ProxyJump machineA' machineB:/myfile.zip .
Vecchio modo
noi# ssh -t machineA ssh machineB
Si può usare scp con proxycommand utilizzando netcat:
scp -v -o \
"ProxyCommand ssh -q machineA nc -q0 %h 22" \
machineB:mysfile.zip .