8

I've got a device at home I want to SSH to from work. The device has port 22 open locally and I have port 22 opened on my AirPort Extreme. However, on the AirPort Extreme it says the open 22 port only goes to my main server IP (10.0.1.100).

The IP I need to access is 10.0.1.104. Again, the device at 10.0.1.104 has port 22 open on it, as I am able to SSH to it on the local network. I can also SSH to 10.0.1.100 with no issues.

When I try to add an additional port forwarding entry, AirPort Utility says there is already a port forward listed for 22 since it's already open, but is pointing to 10.0.1.104.

I feel like there is a way to specify the IP in the SSH syntax, but I'm not sure what it is.

Thanks.

2
  • By main server, do you mean the airport extreme, or another computer?
    – cocoahero
    Feb 6, 2012 at 22:53
  • I've got a Mac Pro with 10.6 Server used as a AFP, Time Machine, DNS, Web, and Media server as well as an APX.
    – Matt Love
    Feb 7, 2012 at 3:26

4 Answers 4

8

One way to do what you want here is to add a port mapping in your Airport Extreme that points a non-standard remote port (e.g. 8022) to port 22 on your local 10.0.1.104 machine. Then, you can specify a different port in your SSH client (e.g. '-p 8022') to gain remote access.

You could also SSH into 10.0.1.100 first, and then SSH into 10.0.1.104 from that machine.

2
  • I will probably use the second of your suggestions. I'll leave this open for a bit longer to see if anyone has any other suggestions. Thanks.
    – Matt Love
    Feb 6, 2012 at 20:36
  • No, problem, glad one of those works for you. I'd also be curious if there's a more elegant solution. However, as far as I know, with NAT (en.wikipedia.org/wiki/NAT) there's no way to directly access a server through a router without explicit port mapping (at least, without an exploit of some sort). Feb 6, 2012 at 21:09
5

If connecting from another Mac, the easiest way would be setting up Back to My Mac. All you need is a working iCloud account with Back to My Mac enabled in the iCloud preference pane. There is no need to configure any port forwarding with this set-up, and you can still connect to the default port 22.

Once you set it up on both Macs, in Terminal.app you can go to Shell - New Remote Connection, select Secure Shell (ssh), and your Mac at home should be listed there. You can also take note of the host name to use to launch a connection from the shell.

It is often overlooked Back to My Mac works with all the different services you can enable in the Sharing prefpane, and not just for accessing your files over a fileshare.

2
  • 1
    The issue is here that the device on the home network I'm trying to connect to is a jailbroken AppleTV. Unfortunately, Back to My Mac is not an option for that. This would be an excellent solution for a Mac, however. And you're right - it is often overlooked. Thanks!
    – Matt Love
    Feb 7, 2012 at 3:28
  • 1
    Do you have any Macs at home that you could use as an intermediate step? I ssh via BTMM to a computer at home, and from there ssh to my jailbroken AppleTV over the local network. May 4, 2012 at 7:18
0

Is there any reason you cannot configure your Airport Extreme as a bridge?

If you really need routing from your Airport Extreme, then of course this won't work. But unless you're using its built-in modem or WAN port to connect to the Internet, I'd suggest just using it as a bridge. Then everything "Just Works," and there's no port-mapping making things difficult.

2
  • This may depend on your ISP; I think mine will only give me a single IP address. Feb 9, 2012 at 19:20
  • yeah, my ISP only give a singular IP. The APX acts as the DCHP provider and a gigabit switch for my Mac Pro and other devices I need to connect. The WAN port connects directly to the internet.
    – Matt Love
    Feb 9, 2012 at 19:33
0

From my experience, I'd use IPV6 instead of IPV4 if your ISP permit. Using IPV6 you can address each machine on your local network because part of the IPV6 is the MAC address of the machine.

You must log in to answer this question.

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