Skip to content

Instantly share code, notes, and snippets.

@mjs
Created August 1, 2018 23:22
Show Gist options
  • Save mjs/b2decf74dde518ce709b9140ecbc4ecb to your computer and use it in GitHub Desktop.
Save mjs/b2decf74dde518ce709b9140ecbc4ecb to your computer and use it in GitHub Desktop.
Helper for using scp through a jump host
#!/bin/sh
if [ $# -lt 3 ]; then
echo "usage: sshj <jump_host> <source> <target>"
exit 1
fi
jump=$1
shift
exec scp -o ProxyCommand="ssh -W %h:%p $jump" $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment