Networking – SSH connection under UDP


Is there a way to establish a SSH connection over UDP?

I'm running behind a "filter all inbound TCP traffic" firewall so I cannot utilize a SSH tunnel properly.

I have set up over at my brothers that I have control over (SSH). I want to connect to it from behind the firewall to somehow port forward to the MySQL and Redis databases I have on my servers behind the firewall.

Best Answer

The Mobile Shell (Mosh).

Prerequisites of the server

The major drawback of mosh is that it requires the server to fulfill additional prerequisites which are not needed by ssh itself. Due to its design, mosh needs the server to allow direct connections via UDP. Servers not fulfilling these prerequisites cannot be used by mosh. Examples of such systems include servers behind firewalls which restrict connections to the ssh-port via TCP. Also problematic are servers which are only indirectly reachable. The latter is usually accommodated by ssh via the 'ProxyCommand' option, but this is not supported by mosh.

One port per connection.

By default, the server tries to allocate the first free UDP port in the range 60000-61000, per connection. This dynamic port allocation is considered an extra burden and risk for firewall maintenance. A significant part of the firewall-filtering happens through connection tracking, so called stateful filtering, this is based on the SYN/ACK flags in TCP segments, UDP packets don't have such flags.

Other things.

  • No IPv6 roaming support.
  • Scrollback is not supported in the current release of mosh, and when using it in a terminal emulator with scrollbars they disappear.
  • Lack of SSH-Agent forwarding.
  • Lack of X-11 forwarding.

For more see SSH vs Mosh.

Related Question