Tutorials/Tips

Solution to freezing SSH sessions on Ubuntu 16.10

I manage several cloud servers via SSH, but after upgrading my main desktop to Ubuntu 16.10 (from Ubuntu 16.04), I observed that those (SSH) sessions would freeze just after a few seconds of inactivity, even right in the middle of editing a file.

I figured that the servers were not the problem, because that has never happened before, and the fact that it didn’t matter what Linux distribution the remote server was running. So there must have been a change in the default client configuration that was causing the problem.

Startpage to the rescue, which led me to this article. The fix offered by the author in that article is for Mac OS X, but it works just as well on any Linux distribution, with one less command to execute.

Related Post:  4 open source alternatives to Trello that you can self-host

The fix is to set values for ServerAliveCountMax and ServerAliveInterval for the SSH client, which you do in a configuration file in the .ssh directory of your home folder. So create and open the file using the following command:

Then add the variables and their values in the following code block to it.

Related Post:  Just a few tricks to make you more efficient at the command line

Close the file. That should solve your freezing SSH session issues. No need to adjust the file’s permissions, because the default is good enough. For more information about those and other variables, consult the manual page using man ssh_config.

openSSH logo

LinuxBSDos needs your donation to continue!

I hope this article has saved you valuable time and effort to fix a problem that would have taken more time than is necessary. That makes me happy, and why I love doing this. But because more people than ever are reading articles like this with an adblocker, ad revenues have fallen to a level that's not enough to cover my operating costs. That's why I want to ask you a favor: To make a one-time or recurring donation to support this site and keep it going. It's a small favor, but every one counts. And you can make your donation using Patreon or directly via Paypal. Thank you for whatever donation you're able to make.

Donate via Patreon. Donate via Paypal.

Aside from donation, you may also signup to receive an email once I publish new content. Your email will not be shared or traded to anyone. And you can unsubscribe at any time.

Please share:

We Recommend These Vendors and Free Offers

Launch an SSD VPS in Europe, USA, Asia & Australia on Vultr's KVM-based Cloud platform starting at $5:00/month (15 GB SSD, 768 MB of RAM).

Deploy an SSD Cloud server in 55 seconds on DigitalOcean. Built for developers and starting at $5:00/month (20 GB SSD, 512 MB of RAM).

Want to become an expert ethical hacker and penetration tester? Request your free video training course of Online Penetration Testing and Ethical Hacking

Whether you're new to Linux or are a Linux guru, you can learn a lot more about the Linux kernel by requesting your free ebook of Linux Kernel In A Nutshell.


Leave a Comment

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

*