|
|
|
|
|
by Symbiote
2808 days ago
|
|
Here are the example commands, with the SSH equivalent. There's a small syntax difference, but otherwise I don't think this tool adds much. $ mole -local 127.0.0.1:3306 -remote 127.0.0.1:3306 -server example@172.12.0.100
$ ssh -L3306:127.0.0.1:3306 example@172.12.0.100
$ mole -v -local 127.0.0.1:8080 -remote 172.17.0.100:80 -server user@example.com:22 -key ~/.ssh/id_rsa
$ ssh -v -L8080:172.17.0.100:80 -p 22 -I ~/.ssh/id_rsa user@example.com
$ mole -v -local 127.0.0.1:8080 -remote 172.17.0.100:80 -server example1
$ ssh -v -L8080:172.17.0.100:80 example1
$ mole -remote 172.17.0.100:80 -server example1
$ ssh -L2937:172.17.0.100:80 example1
NB Random port is predefined to be 2937, see https://xkcd.com/221/. Or use $RANDOM.
$ mole -v -local :8080 -remote 172.17.0.100:80 -server example1
$ ssh -L8080:172.17.0.100:80 example1
NB difference with SSH, -L:8080... would bind the local port to 0.0.0.0:8080.
$ mole -v -local 127.0.0.1:8080 -remote :80 -server example1
$ ssh -L8080:127.0.0.1:80 example1
$ mole -alias example1 -v -local :8443 -remote :443 -server user@example.com
Add to SSH config: "LocalForward 8443 localhost:443"
I don't know if Mole supports it, but SSH also has the option to forward a remote port through the local machine. home $ ssh -R8888:example.net:80 work.example.com
...
work $ curl -H "Host: example.net" localhost:8888
But the most useful of all is perhaps: work $ ssh -D3128 personal-vm-or-raspberry-pi-whatever.example.net
Then configure Firefox to use a SOCKS proxy on localhost:3128. You now bypass any corporate HTTP proxy. |
|
ETA: largely redundant comment now the parent now also mentions this option. :)