Created
April 11, 2018 08:42
-
-
Save njleonzhang/ff9117ed8c2d5099c4b4a82e60ce600e to your computer and use it in GitHub Desktop.
port forwarding
This file contains hidden or 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/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