In my daily work I need SSH tunnels to work with remote virtual environments and services.
I wrote this simple tool to automate the SSH tunneling and to make it easier to switch between environments
by leveraging dynamic port forwarding with SSH and Firefox profiles.
- macOS
- Firefox
The tool has been tested on macOS Sierra and apart from the Firefox functionallity should work on any other Linux\Unix distro
without much rework.
Run the installer with sudo permissions:
sudo ./install.sh
Open the configuration file and configure the aliasses, IPs and ports:
sudo vim /etc/sshtun/sshtun.conf
Sample config will look something like this:
|alias| |address| |ssh_user| |port|
local 127.0.0.1 root 5557
example 192.168.10.1 foo 5558
sshtun -s alias
sshtun -l
sshtun -k
sshtun -r alias
sshtun -s alias -r alias
If for some reason you forgot your aliases you can simply show them:
sshtun -c
- Chaining multiple command options does not work properly
The current implementation of the options parsing does not handle chaining very well
Example:
# This will NOT WORK
sshtun -sr alias