Skip to content

Instantly share code, notes, and snippets.

@hrlai
Created August 9, 2022 02:46
Show Gist options
  • Save hrlai/6e1f051611197cc6d712107ab69536cf to your computer and use it in GitHub Desktop.
Save hrlai/6e1f051611197cc6d712107ab69536cf to your computer and use it in GitHub Desktop.
Using rsync with ssh tunnelling
# Suppose we want to sync files through host A -> host B -> local C
# replace <port number>, <username>, <hostnameB>, <hostnameA>
rsync -av -e 'ssh -o "ProxyCommand ssh -p <port number> -A <username>@<hostnameB> -W %h:%p"' <username>@<hostnameA>:path/to/folder local/path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment