stupid question (maybe?) - remote ssh into different computers behind one IP address?


Dec 7, 2001
So, this is a super basic networking question I suppose, but here is the situation:

I have two Mac computers at my office. I have "remote login" enabled on both of them (basically SSH access). I would like to be able to access the computers via SSH remotely, but in my mind it seems that it wouldn't really be posible. It seems like I'll have to setup my firewall to allow outside access by forwarding port 22 to a specific computer (IP address). So all traffic from outside to port 22 will be directed (by the router) to a specific computer.

Is that correct?

Would the solution to this be to change the port that one of the computers is listening to SSH requests on to something different (some other random port?), and then forward that port to the second computer?

Thanks in advanced for any help! I appreciate it!!!
if you want more complicated look up ssh port tunneling :p
If your router supports it, you can forward things from one port to another. IE : router:22->MacA:22, router:2222->MacB.
Why not just change the port on one of them to something else and port forward them both? Otherwise, ssh into one then ssh into the other locally.

This does not belong in programming.