


Set the right port ( 5222 in this example) Check SOCKS v5. Fill the field SOCKS Host with localhost. Then you should be able to just do: rsync -azv foo/ C. Go to Preferences > Advanced > Network > Settings. Or, using ProxyJump for OpenSSH >= v 7.3: Host C Here some example with values, which will execute uptime with root user on a host 192.168.1.1./ssh.exp 192.168.1. Prox圜ommand ssh -A PROXYHOST -p 22 -W %h:%p Finally you can run the script with the following usage./ssh.exp IP SSHPORT SSHUSER SSHPASS SSHCOMMAND. Specifically, add something like this: Host C If by chance you don't have a new enough ssh version (>= 5.3, IIRC), you can use netcat instead of -W option to ssh: rsync -azv -e 'ssh -o "Prox圜ommand ssh -A PROXYHOST nc %h %p"' foo/ dest./foo/įinally, as noted in comments already, you can put the Prox圜ommand into your $HOME/.ssh/config file so you don't have to have such a complicated command line.
#RSYNC WITH SSH PROXY PASSWORD#
Note that I'm using -A (agent forwarding) but it should also work with password authentication if you don't use keys, and, of course, you can replace proxy with B and dest with C in your example. Or, if your version of ssh is new enough (OpenSSH >= v7.3), you can use the -J ( ProxyJump) option rsync -azv -e 'ssh -A -J foo/ dest./foo/

Since the latter includes my answer, but no answer was accepted, I'll repeat it here.Īs you noted, you can use rsync's -e | -rsh option, but it's going to be a bit more complicated: rsync -azv -e 'ssh -o "Prox圜ommand ssh -A PROXYHOST -W %h:%p"' foo/ dest./foo/ This question is essentially answered elsewhere, including here for scp and here for rsync.
