Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
alias ssh-tunnel='function _ssh_tunnel(){ set -x; port=$(gshuf -i 39152-65530 -n 1); ssh -f -N -L$port:$1:22 ec2-user@<DMZ_IP> -i ~/.ssh/dmz.pem ; ssh -i ~/.ssh/prod.pem ec2-user@127.0.0.1 -p $port ;};_ssh_tunnel'
# to run:
ssh-tunnel <SOME PROD IP>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment