Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Abreto
Created December 5, 2018 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Abreto/9dd31cc8731033fd0d3aa739e8e36798 to your computer and use it in GitHub Desktop.
Save Abreto/9dd31cc8731033fd0d3aa739e8e36798 to your computer and use it in GitHub Desktop.
ssh proxy scripts
#!/usr/bin/env bash
ps aux | grep "[0-9] ssh -qTfNn -D 7070"
#!/usr/bin/env bash
eval $(ps aux | grep "[0-9] ssh -qTfNn -D 7070" | awk '{print "kill -9 "$2}')
port=7070
user=root
host=
case $1 in
hk )
host=hk_server
;;
fm )
user=special_user
host=fm_server
;;
la )
host=la_server
;;
sh )
user=another_user
host=sh_server
;;
*)
echo 'usage: ./connect <server_alias>'
echo 'server list: hk fm(fremont) la'
exit
;;
esac
echo connecting to $host
ssh -qTfNn -D $port $user@$host
#!/usr/bin/env zsh
ALL_PROXY=socks5://127.0.0.1:7070 $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment