I've been trying to setup reverse SSH tunnelling from outside my network to home but I've beet getting no-where. My setup is all Apple: two Macs behind an Airport Extreme, one at x.x.x.20 listening on port 22 and the other at x.x.x.30 listening on 10,022. I've setup NAT on the AP to forward external ports 22 to the x.x.x.20 and 10,022 to x.x.x.30. I want the tunnel to run to x.x.x.20:10022.
I've been using this command from an apple device outside of my home network: ssh -v -f -N -R 22:localhost:10022 [email protected]
as well as ssh -v -f -N -R 10022:localhost:22 [email protected]
but either way, the logs on the x.x.x.20:22 listening machine show that the traffic goes to it and the x.x.x.30:10022 machine show no record in the secure.log file. I've even tried ssh -v -f -N -R 10022:localhost:10022 [email protected]
and the traffic still hits the x.x.x.20:22 listening machine.
The strange thing is that when i run ssh -p 10022 [email protected]
it connects to the x.x.x.30:10022 listening machine just fine. I've gone through every NAT rule in the Airport as well and there's only one rule covering port 10022 so it's not a NATing problem as far as the AP's configuration is concerned.
Either I'm doing something really wrong, there's a bug in Apple's implementation of reverse SSH tunnels or that the Airport is doing something funny with the traffic. Has anyone else had this problem or found a workaround?
The guide I'm running to get the reverse tunnel running is http://www.vdomck.org/2005/11/reversing-ssh-connection.html
Thanks in advance!