Darren Kitchen Posted July 26, 2014 Posted July 26, 2014 with autossh setup in the typical way (known_hosts setup, autoorized_keys copied to server) and the server configured as usual (AllowTcpForwarding yes, GatewayPorts yes) one can conveniently forward arbitrary ports, such as 80, rather than the typical 22 with the following command: ssh -i /root/.ssh/id_rsa -N -T -R localhost:80:0.0.0.0:80 root@<server ip> Bonus: using "-Cav" on the SSH command provides useful debug info such as "debug1: All remote forwarding requests processed" Of course make sure the SSH server you're forwarding 80 through doesn't also have a www server like apache running. Quote
fringes Posted July 27, 2014 Posted July 27, 2014 Darren, just to be clear... This command should port forward (-R) port 80 from the pineapple (localhost:80) to all interfaces (e.g. NICs) on the remote server (0.0.0.0:80), correct? You can of course combine this with multiple -L or -R port forwards on the same tunnel. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.