Due to the pandemic, many of us have started working remotely, relying heavily on SSH to connect to remote machines located in data centres where development, build and run activities are performed. Although SSH is a powerful tool, it has its shortcomings, including connection drops, reconnection issues when switching networks, and slow and unresponsive connections, which can be manageable under stable network conditions.
However, working from home often means dealing with unstable connections, such as switching to a mobile network or experiencing network disruptions, which can make working with SSH frustrating and disrupt the workflow. Fortunately, there was a solution: Mosh.
Mosh, short for mobile shell, is a shell client/server protocol that uses UDP instead of TCP. It is designed to be more resilient than SSH when dealing with high latency, spotty connections, and intermittent dropouts, making it ideal for remote workers.
Some of the notable features of Mosh include:
- Resilience: Mosh is designed to handle network issues such as high latency and intermittent dropouts, making it more resilient than SSH.
- Session persistence: Mosh keeps your session alive even if you lose your connection or put your laptop to sleep, so you can pick up where you left off when you reconnect.
- Predictive input: Mosh uses local prediction to anticipate what you’re going to type and provides real-time feedback, reducing the latency between keystrokes and output.
- Instant response to typing and line editing: Unlike SSH, Mosh gives an instant response to typing, deleting, and line editing, which can make for a better user experience.
- Graceful handling of packet loss: Mosh uses a UDP-based protocol that handles packet loss gracefully, ensuring that Control-C works great.
Installing Mosh is easy, and the package can be found on the Mosh website. The installation requires minimal configuration, and Mosh works seamlessly with your existing SSH setup, allowing you to start using it right away without making significant changes to your system.
In conclusion, Mosh is an excellent tool that provides a smoother and more reliable remote terminal experience than SSH, especially in situations where network connectivity is unstable or intermittent. If you’re a remote worker who relies heavily on SSH and wants to improve your workflow and productivity, Mosh is definitely worth considering.
For installation, configuration, internal working and FAQs you can refer https://mosh.org/