-
-
Save YourFriendCaspian/335ea9bd2aa717b154f19fd3af99b8db to your computer and use it in GitHub Desktop.
Useful Bash/Linux SSH tunnelling commands
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
## Start SSH agent | |
eval "$(ssh-agent -s)" | |
## Open SSH tunnel on port 3307 | |
ssh -fN -L 3307:127.0.0.1:3306 [email protected] | |
## Check the tunnel is active | |
sudo netstat -lnp | grep ssh | grep :3307 | |
## Close the tunnel | |
ps aux | grep ssh | grep 3307 # get the pid | |
kill <pid> # kill process |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment