Forum Thread: How to Connect to an SSH Server That Is Port-Forwarded on Another Network?

I am having trouble (a lot of it) grasping the concept of port forwarding ssh servers. I want to be able to connect to a device on another network that is port forwarded. How can I do this?

Box 1: Separate network
Box 2: Port forwarded on port 4444 external and 22 internal (assuming the router re-directs 4444 to 22)

How exactly do I connect to it?

4 Responses

Open up the Terminal and type:
ssh ip.of.box.2
...and then authenticate when it prompts you. Or you can do the whole lot in one go, the general ssh syntax is:
ssh user@host
...and you'll be left to enter the password.

TRT

If the service is configured on another port (not default 22) the syntax is:
ssh -p <port (in your case 4444)> user@host

Indeed, my bad for not paying attention to the question. Thanks for the correction :)

Thanks guys. Makes sense now :)

Share Your Thoughts

  • Hot
  • Active