Security News > 2021 > May > How to achieve persistent SSH connections with the open source MOSH
You don't want that, which is why you should employ a tool like MOSH. MOSH stands for Mobile Shell and makes it possible for you to keep a persistent SSH connection-even if you change networks or your connection momentarily drops.
Under the hood, MOSH logs the user in via SSH and then starts a connection on a UDP port between 60000 and 61000, to keep the connection persistent.
MOSH is available for Linux, macOS, Windows, Android and iOS. You must install the MOSH package on both the server and the client.
How to install MOSH. MOSH is found in my distribution standard repositories.
Sudo dnf install mosh -y. Make sure you install MOSH on both your client and your server.
That's all there is to gaining a more reliable SSH connection between your client and server, with the help of MOSH. Give this tool a try and see if you find your SSH connections staying connected, even as you roam from one network to another.