Skip to content

Instantly share code, notes, and snippets.

@alexanderschnitzler
Forked from garethrees/rsync.sh
Created October 9, 2020 12:19
Show Gist options
  • Save alexanderschnitzler/c4b80cfc6ff00e1199698ee5ca34b67a to your computer and use it in GitHub Desktop.
Save alexanderschnitzler/c4b80cfc6ff00e1199698ee5ca34b67a 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