mjrmua
January 21st, 2009, 05:04 AM
I have the following setup:
(Machine A) -- (router A) -- (Internet) -- (router B)--(Machine B)
I would like to be able to SSH from Machine A to Machine B.
Both routers NAT'ing, and port forwarding port 22.
I'm trying to establish a reverse SSH tunnel from B to A, and then ssh from A to B over the tunnel (Because I want to turn off port forwarding on routerB). As follows:
MachineB$ ssh -NT -R 1234:localhost:22 -p 22 username@<routerA_public_IP>
MachineA$ ssh username@localhost -p 1234
This works fine if I put Machine A and B on the same network.
But if I move B behind its router:
-The tunnel is established correctly
-I can still ssh A->B, and B->A
but when I try to ssh from A to B over the tunnel I get the folowing error:
MachineA$ ssh username@localhost -p 1234
ssh_exchange_identification: Connection closed by remote host
Any ideas on what's going wrong here?
(Machine A) -- (router A) -- (Internet) -- (router B)--(Machine B)
I would like to be able to SSH from Machine A to Machine B.
Both routers NAT'ing, and port forwarding port 22.
I'm trying to establish a reverse SSH tunnel from B to A, and then ssh from A to B over the tunnel (Because I want to turn off port forwarding on routerB). As follows:
MachineB$ ssh -NT -R 1234:localhost:22 -p 22 username@<routerA_public_IP>
MachineA$ ssh username@localhost -p 1234
This works fine if I put Machine A and B on the same network.
But if I move B behind its router:
-The tunnel is established correctly
-I can still ssh A->B, and B->A
but when I try to ssh from A to B over the tunnel I get the folowing error:
MachineA$ ssh username@localhost -p 1234
ssh_exchange_identification: Connection closed by remote host
Any ideas on what's going wrong here?