Simple Shell Script to Manage SSH Tunnels
Manage SSH Tunnel is a simple shell script to start and stop ssh tunnels from the terminal.
Setup
Note: the setup assumes bash as the default shell
- Download tunnel.sh and save it to ~/bin/
Add to
~/.bash_profileor~/.bashrcalias tunnel_home='/bin/sh ~/bin/tunnel.sh example.net sam 22 8888'Replace example.net with the hostname of the server, sam with the username on the server, and 8888 with the local tunnel port
- Type
source ~/.bash_profileorsource ~/.bashrc
Usage
To open the tunnel
tunnel_home startTo close the tunnel
tunnel_home close