SpiderElectron

Electronic Engineering Blog

SSH sessions over Starlink connections

After I moved my broadband package from a traditional ISP-over-copper to the Satellite based Starlink service, I noticed that my SSH sessions to remote servers would suffer from broken pipes and disconnections far more often than I’d experienced before. Initially I though this was due to short drop-outs while my Starlink terminal hopped from one satellite to another, but it turned out to be something more interesting. The fix was quick and simple.

The cause of the dropouts was the Starlink router’s more aggressive killing of idle connections which it believed to be dead. If I left my SSH session at a prompt for about 5 mintes it would get disconnected.

The solution was to edit the local SSH config on my client machine to send keep-alive packets when the session is idle. I made a corresponding change to the ssh daemon running on my hosted server too.

Here’s the details.

One the server (in my case Ubuntu 18.04) I edited /etc/ssh/sshd_config to include the following two lines:

Lines added to /etc/ssh/sshd_config

And on my client, (macOS 12.3) I edited ~/.ssh/ssh_config to contain the following lines:

Contets of ~/.ssh/config

Both of these changes do similar things – they cause the client (and server) to send keep-alive packets if the connection is idle for more than the specified interval (in seconds).

Now I can keep my sessions alive indefintely and the problem with broken pipes and disconnections has gone away.

, , ,

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.