2

On my mac computer at work behind a corporate firewall, I ssh into my home dd-wrt router over the internet, creating a reverse tunnel:

ssh -R 1079:localhost:22 myhomepc.ddns.net

So now, when I'm home, I ssh into my home dd-wrt router, and I can log into my mac at work from the bash prompt on the dd-wrt router

ssh localhost -p 1079

That works. HOWEVER, what I really need is to log into my mac from another computer on my LAN, so I tried:

ssh 192.168.1.1 -p 1079

But this does not work. The question is: How do I expose port 1079 on my dd-wrt router (192.168.1.1) so that other computers on my LAN can hit port 1079?

(FYI, here is the output from using telnet to try to hit the port from ubuntu)

root@ubuntu:~# telnet 192.168.1.1 1079
Trying 192.168.1.1...
telnet: Unable to connect to remote host: Connection refused
1

One way to do this is to set up a local port forward, by sshing into the router and reforwarding port 1079 to something else on localhost. example:

set up forward:

ssh -L 22022:localhost:1079 192.168.1.1

use forwarded port:

ssh -p 22022 127.0.0.1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.