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

https://www.profitableratecpm.com/f4ffsdxe?key=39b1ebce72f3758345b2155c98e6709c

If you’ve ever logged in to SSH and your connection was interrupted, you may have found yourself typing on your keyboard frustrated. One day I found the solution to SSH connection interruptions during a July 4th weekend.

Complete HTG Wrapped Calendar - December 24

HTG Wrapped 2025: 24 days of technology

24 days of our favorite hardware, gadgets and technologies

The 4th of July that changed everything

One July 4th around 2012, I was spending a day off aimlessly browsing the internet. I was also logged into a shell account on SDF, where I am a permanent member of “MetaARPA”.

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

This service allows users to run all kinds of processes. Being a shell server, network related tools are popular. I ran a ps command on the system to see what other users were running. A new process caught my attention that I had never seen before. We called it “mosh.” I called up the man page to see what it was about:

man mosh

That’s where I discovered a new tool that solved a problem with SSH that I never knew existed.

What Mosh did for me

Mosh website.

SSH was a welcome replacement for 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 hadn’t even been ratified yet.

If you’ve ever had a Wi-Fi connection drop when you connected to a remote SSH server, you’ve probably seen the remote server stop returning what you type. Even after your Wi-Fi connection is restored, nothing happens when you type in the terminal window. All you can do is close SSH and log in again.

A terminal multiplexer like GNU Screen or tmux can help alleviate this problem by leaving a session open and allowing you to log in again when you reconnect, but dealing with this problem can be annoying because you have to kill and restart the SSH client.

A session on a remote machine using SSH in the Linux terminal.

Mosh is different. It allows you to maintain a current session and even reconnect automatically. You can also change your connection, from Wi-Fi to cellular to wired, and continue your SSH sessions.

Even if the connection is interrupted, mosh will echo your keystrokes on the screen. If the connection is restored, you can continue what you were doing. mosh is one of those tools I’ve never been able to live without. This is one of the first terminal applications I install on a new system.

The value of fictitious accounts

SDF bboard bulletin board system in a Unix shell account.

This episode shows that shell accounts are valuable for serious Unix users like me. While dummy accounts were the dominant form of public access to the Internet in the early 1990s, when ordinary people outside of universities and research labs began accessing them, they became largely obsolete as the price of direct Internet connections fell and graphical browsers became the primary means of accessing the Internet.

One reason to use them is so you can keep tabs on what technical users of the Internet are doing. I discovered this directly using the ps command.

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

One thing I realized from this adventure is that sometimes I will endure frustrations until I find a solution. The problem of connecting with SSH over spotty Wi-Fi was one that I didn’t seem to consider a problem. Many solutions are ones that scratch an itch I had no idea about.

The World Wide Web could have been an original example. While many people did without it, when Mosaic popularized the web in the ’90s, it seemed like everyone had to participate. It was like the hype around AI today.

You should try to find all the problems related to your technology and see what possible solutions are available. As Eric S. Raymond writes in his classic book, The Cathedral and the Bazaar“All good software work starts by scratching a developer’s personal itch.”

If you’re looking for programming project ideas, one source is things you find boring. You could try writing a script to modify an existing program, similar to how Mosh modified SSH into something that remains active even when the network doesn’t.


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

You must be on the lookout for new tools and be willing to solve your own problems and possibly those of others.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button