View Full Version : [ubuntu] Port changing ssh tunnel

May 12th, 2008, 11:26 PM
Hey I was happy connecting to a host via ssh however due to Router changes the prots have become unusable. How do I connect out on another port

I was always using ssh -ND 23 lol@somehost.org

But now it won't connect how do I get it through other ports?

May 12th, 2008, 11:58 PM
Specify the remote port with the -p option.

ssh --help

May 13th, 2008, 12:56 PM

ssh -ND 23 -P 80 lol@somewhere.org

May 13th, 2008, 01:02 PM
Your remote ssh server has to be listening on that port for it to work.

You need to add a "port #" line to your distant sshd_config file (where # is the port number you wish to use).

In your case, you'll need to add "Port 80", then restart the ssh service.

After than, "ssh -ND localhost:23 -p 80 lol@somewhere.org" should work.
Mind that localhost:23 binds the socks proxy to your localhost on port 23, and only allows access from localhost. Then socks forwards whatever you send it to your distant server using port 80.

Hope this helps :)

- Trib'

PS: We are not discussing circumventing a firewall here I guess, since I'm pretty sure you know it is against the forum's code of conduct... Don't you?

May 13th, 2008, 01:13 PM
Yeah 100% we're talking about the host changing here ;)