Created
January 22, 2014 08:51
-
-
Save remino/8555512 to your computer and use it in GitHub Desktop.
ssh-via: Connect to SSH host via proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ssl_via() { | |
if [ $# -lt 2 ] | |
then | |
ssl_via_usage | |
return | |
fi | |
ssl_via_main $@ | |
} | |
ssl_via_main() { | |
proxy=$1 | |
shift | |
ssh -o "ProxyCommand ssh -A $proxy nc %h %p" $@ | |
} | |
ssl_via_usage() { | |
echo "Usage: `basename $0` proxy host [options]" | |
} | |
ssl_via $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment