Skip to content

Instantly share code, notes, and snippets.

@garethrees
Last active June 19, 2024 04:59
Show Gist options
  • Save garethrees/53239b2295e988ff7fd42310332abf15 to your computer and use it in GitHub Desktop.
Save garethrees/53239b2295e988ff7fd42310332abf15 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/
@robertmorel-uk
Copy link

Thank you sir

@cirrus3d
Copy link

cirrus3d commented Aug 29, 2022

This worked for me:

# Download
 rsync -av -e "ssh -J JUMP_HOST" DEST_HOST:FILE_TO_DOWNLOAD ~/Downloads/

@nem8
Copy link

nem8 commented Dec 5, 2023

This worked for me:

# Download
 rsync -av -e "ssh -J JUMP_HOST" DEST_HOST:FILE_TO_DOWNLOAD ~/Downloads/

Yeah this worked for me as well in Ubuntu 22.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment