SSH over bad Wi-Fi is miserable, and this CLI tool fixes it

If you’ve ever logged into SSH and your connection dropped, you’ve probably found yourself tapping at your keyboard in frustration. One day, I found the solution to an SSH connection dropout over the 4th of July weekend.

HTG Wrapped 2025: 24 Days of Technology

24 days of our favorite gadgets, gadgets, and tech

The Fourth of July that changed everything

Around the 4th of July 2012, I was spending my day off aimlessly surfing the Internet. You are also logged into your shell account at Syrian Democratic Forceswhere I am a permanent member of “MetaARPA”.

If you’ve never tried a shell account, it’s a web service that delivers slices of a Linux or Unix server to regular users. Many of them are free, but this app offers more services in exchange for user donations.

This service allows people to run all kinds of operations. Being a server shell, networking related tools are very popular. I ran the ps command on the system to see what other users were doing. A new process caught my attention that I had never seen before. It was called “Mish”. I contacted the home page to find out what it is about:

man mosh

This is where I discovered a new tool that solved a problem in SSH that I never knew I had.

What Mosh did for me

Mosh website.

SSH was a welcome alternative to Telnet when it appeared in the mid-1990s, because it encrypted the connection to hide it from people who might want to steal your username and password. Although it was useful, SSH was rooted in the era of wired Internet connections. The Wi-Fi standard has not yet been ratified.

If you’ve ever lost your Wi-Fi connection when you connected to a remote SSH server, you’ve probably seen the remote server stop repeating what you type. Even after your Wi-Fi connection is back on, nothing will happen when you type in the terminal window. All you can do is close SSH and reconnect.

A terminal multiplexer like GNU Screen or tmux can help alleviate this by leaving the session and allowing you to reconnect when you reconnect, but dealing with this issue can be annoying, as you have to stop and restart the SSH client.

Session on a remote machine in SSH into a Linux terminal.

not various. It allows you to keep the session running and even reconnect automatically. You can also switch connections, from Wi-Fi to cellular to wired, and keep SSH sessions going.

Even if the connection is lost, mosh will repeat the keystrokes on the screen. If the connection comes back, you can continue what you were doing. Mosh is one of those tools that I never knew how to do without. It’s one of the first terminal applications I install on a new system.

Shell accounts value

SDF bboard system in a Unix shell account.

This episode shows that shell calculations are valuable to serious Unix users like me. While shell accounts were the dominant form of public Internet access in the early 1990s when ordinary people outside universities and research laboratories began to access the Internet, they have become largely obsolete with the decline in prices of direct Internet connections and the emergence of graphical browsers as the main way to access the Internet.

One of the reasons to use these things is so you can follow what technical Internet users are doing. I found this out directly using the ps command.

Indirectly, I can find out what other users are doing by looking at what they are saying. SDF has a dedicated bulletin board and chat system where users like to talk about their projects.

One thing I’ve realized from this adventure is that sometimes I will endure frustrations until I find a solution. The issue with SSH connection over unstable Wi-Fi was an issue that I didn’t seem to consider a problem. A lot of the solutions are ones that are itchy and I had no idea about that.

The World Wide Web was perhaps an archetypal example. While many people were able to do without it, when Mosaic popularized the web in the 1990s, it seemed like everyone had to use it. It was like the hype surrounding AI today.

You should try to find any weak points using your technology and find out what possible solutions are available. As Eric S. Raymond He wrote in his classic book, Cathedral and bazaar“Every good software business starts by scratching a developer’s personal itch.”

If you’re looking for ideas for programming projects, one resource is Things You Find Annoying. You can try writing a script to modify an existing program, in the same way that mosh modified SSH into something that stays up even when the network doesn’t.


If you’re suffering from itching, you’re probably not the only one. You might want to tell people about it on social media, write a blog post for Hacker News, or if you can talk to a website like HTG to publish your work, maybe you can write about it there. That’s the whole point of technology: to make things easier for users.

You must look for new tools, and be willing to solve your own problems and perhaps others’ problems.

Leave a Comment