I configured SSH access to my Mac in order to use Prompt on my iPad. That way I can use my Mac from anywhere in the world, as long as I can get my home IP address.

Although the SSH connection works fine from a separate external connection (my 3G iPhone, for example), it times out when I try to connect from a separate device on the same home wifi network.

As a result, I spent two whole days trying to debug a connection that actually works fine.

Why does an SSH connection that works fine from a separate external address time out when I try to connect from behind the same router?

Is there a workaround so I can just use a single SSH setting whether I am in my living room or on a different continent?

Note: a useful way to get your home IP address (if it's not fixed) is to log into your Gmail account from afar and look at "Last account activity" on the lower right corner of the screen.

  • Answering your question requires some more information about how you are actually connecting and your network setup. Are you using a router, did you map the SSH port through NAT, ...?
    – Gerry
    Dec 19, 2011 at 10:32
  • I am using a router supplied by my internet provider, and I set up the port forwarding through NAT. I confirmed that the port is open using two different web site services. I cannot ping the computer from my local connection, either. Dec 19, 2011 at 10:49
  • And how are you connecting? Are you using the public IP address?
    – Gerry
    Dec 19, 2011 at 12:09
  • When I connect by the local IP address (192.168...) it works. When I connect by the public (seen from outside my house) IP address, I can neither ping or SSH. All this is done from a computer connected to my router, sharing the same public IP address. Dec 19, 2011 at 12:58
  • Works: ssh Administrator@ Doesn't work: ssh Administrator@ All computers are connected to the internet via my wifi router which has the public IP address. I have tried both examples from my Mac ( and my iPad ( There is no difference. If I connect with 3G from the iPad, suddenly ssh Administrator@ works. Dec 19, 2011 at 13:20

2 Answers 2


The router does the NAT on the external interface. However when you ssh to your WAN address the router will recognize packets coming in on on the internal interface as being sent to its own address and will just send them to its local port 22. What you want does exist but isn't often supported, it's called "NAT loopback".

See NAT Loopback Routers


You might try using the bonjour address.

ssh Administrator@mymac.local

Obviously replace mymac.local with the bonjour address for the Mac in question. This can be found in the Sharing preference.

Of course this will only work on the LAN.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .