Skip to content

Instantly share code, notes, and snippets.

@zhu3pang
Forked from garethrees/rsync.sh
Created September 26, 2023 22:14
Show Gist options
  • Save zhu3pang/d7b8604708676dabbf06fa05d9eaabfb to your computer and use it in GitHub Desktop.
Save zhu3pang/d7b8604708676dabbf06fa05d9eaabfb to your computer and use it in GitHub Desktop.
rsync & scp through jump host
# Upload
rsync -av -e "ssh -A JUMP_HOST ssh" FILE_TO_SEND DEST_HOST:/home/gareth/
# Download
rsync -av -e "ssh -A JUMP_HOST ssh" DEST_HOST:~/FILE_TO_DOWNLOAD ~/Downloads/
# Upload
scp -oProxyCommand="ssh -W %h:%p JUMP_HOST" FILE_TO_SEND DEST_HOST:/home/gareth/
# Download
scp -oProxyCommand="ssh -W %h:%p JUMP_HOST" DEST_HOST:FILE_TO_DOWNLOAD ~/Downloads/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment