1

I'am trying to establish a mosh connection over a SSH Tunnel.

the localhost is connected via LAN1 to host1. Host1 has a GSM/GPRS connection to the Internet. Host2 is a raspberry pi in another LAN2 but reachable over port 22 and port 60001 from the Internet (via Port Forwarding). I try the follwoing:

    ssh -L 9998:host2:22  root@host1
    ssh -L 9999:localhost:1234 -p 9998 pi@localhost
    mosh pi@localhost

The establishment of the SSH tunnel itself works. I reach the raspberry pi via ssh. But I can't connected through that tunnel with mosh.

what is wrong here?

Oliver G.
  • 227
  • 5
  • 17

1 Answers1

2

Mosh only uses the SSH channel to exchange a key and check the remote address, then a direct UDP connection is made to the remote address.

You can't connect because the IP address of your PI is an private network (192.168../10...* etc) and not reachable from your host.

Try to use a VPN (ssh -w, openvpn etc) or try to forward some ports (22, 60001 etc) so you don't need to use SSH tunnels.

meeuw
  • 118
  • 2
  • 4