Skip to content

Instantly share code, notes, and snippets.

@njleonzhang
Created April 11, 2018 08:42
Show Gist options
  • Save njleonzhang/ff9117ed8c2d5099c4b4a82e60ce600e to your computer and use it in GitHub Desktop.
Save njleonzhang/ff9117ed8c2d5099c4b4a82e60ce600e to your computer and use it in GitHub Desktop.
port forwarding
#!/bin/bash
echo "port forwarding starting..."
ps aux | grep ssh | awk '{ if($12 != "guxuecheng@ttys002") { print $2 } }' | xargs kill -9
ssh -CfNg -NL 3315:localhost:80 [email protected] -p 2918
ssh -CfNg -NL 3316:localhost:8888 [email protected] -p 2918
ps -ef | grep ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment