Scripts for simplifying management of SSH Dynamic Tunnel.
You my heard MyEnTunnel in Windows or SSH Proxy in OSX, this script does what them do just via an easy-to-use command line.
For Ubuntu and OSX, just run:
wget -qO- https://raw.githubusercontent.com/hsiaosiyuan0/ssh-tunnel/master/install.sh | bash
For other *nix platform, you need to install expect
manually via the platform specific pkg manager.
Option | Meaning |
---|---|
--host | remote ssh host |
--port | remote ssh port |
--user | remote ssh username |
--pass | remote ssh password |
--key | file path of the private key of remote ssh |
--listen | local port |
--action | start | stop | restart |
# choose to use password to do login
$ ssh-tunnel --host=46.76.166.185 --port=22 --user=root --pass=password --listen=7070
# or choose to use key to do login
$ ssh-tunnel --host=46.76.166.185 --port=22 --user=root --pass="" --key="file_path_of_your_private_key" --listen=7070
A config file will be generated at ~/.ssh-tunnel.cfg
after above command succeeds.
$ ssh-tunnel --action=start
$ ssh-tunnel --action=stop
$ ssh-tunnel --action=restart