Skip to main content

How to keep SSH connections alive


This blog describes how to keep SSH connections alive. If you have experience such problems while using SSH, such as dropped or unresponsive connections, you may need to adjust some settings in your SSH client.



KEEPING SSH CONNECTIONS ALIVE


Depending on your hardware and software configuration, you may experience SSH connectivity issues. For example, some types of firewalls may preemptively close connections after a certain amount of time has elapsed.

To work around these types of problems, you can adjust your SSH client's settings. Follow the appropriate procedure below for your own operating system.
Windows operating systems

Microsoft Windows operating systems use the PuTTY program to establish SSH connections. If you experience connectivity issues, you can adjust PuTTY's configuration to help keep connections alive. To do this, follow these steps:

  • Start PuTTY.
  • Load your connection session.
  • In the Category pane, click Connection.
  • Under Sending of null packets to keep session active, in the Seconds between keepalives, type 240.


  • In the Category pane, click Session.
  • Click Save.
  • Connect to your account and monitor the connection. If it stil drops, gradually decrease the keepalive interval until the connection is stable.
     
Linux and Mac OS X operating systems
On Linux and Apple Mac OS X operating systems, the ~/.ssh/config file enables you to specify many SSH settings, including those that keep alive an SSH connection.

For this, follow below steps:
  1. Use your preferred text editor to open the ~/.ssh/config file on your local computer.



  2. If the .ssh directory or the config file do not exist, create them.

  3. Add the following lines to the config file. The Host value can be any name you want; it is simply a label for the other settings. The Hostname value is the remote host you want to access; replace netwyman.com with your domain name. Replace newuser with your own A2 Hosting account username:

          Host netwyman
          Hostname netwyman.com
          Port 7822
          User newuser
          ServerAliveInterval 240
          ServerAliveCountMax 2




Save the changes to the config file.
Connect to your account using SSH. To do this, simply type ssh example where example represents the Host value you specified in step 2.
Monitor the connection. If it still drops, gradually decrease the ServerAliveInterval setting in the config file until the connection is stable.



Comments

Popular posts from this blog

What is STP? - Explain Advantages and Disadvantages

The Spanning Tree Protocol is a network protocol that builds a loop-free logical topology for Ethernet networks. The basic function of STP is to prevent bridge loops and the broadcast radiation that results from them. STP is a protocol. It actively monitors all links of the network. To finds a redundant link, it uses an algorithm, known as the STA (spanning-tree algorithm). The STA algorithm first creates a topology database then it finds and disables the redundant links. Once redundant links are disabled, only the STP-chosen links remain active. If a new link is added or an existing link is removed, the STP re-runs the STA algorithm and re-adjusts all links to reflect the change. STP (Spanning Tree Protocol) automatically removes layer 2 switching loops by shutting down the redundant links. A redundant link is an additional link between two switches. A redundant link is usually created for backup purposes. Just like every coin has two sides, a redundant link, along with...

How to Reset Steam Password? – Recover Your Steam Password

Are you suffering with Reset Steam Password? This blog will help you. What is Steam? Steam is the online website for getting the best games for paid. If you are a true game lover then you should have an active account on Steam. Many of people lost their password during the  PC clean-up  or any other circumstances. At that time they have to reset Password of all accounts. Then if you facing issues with the password, you forced to Steam reset password to access the Steam account. We are going to share the guide that how to recover your forgotten Steam Password and make your existing account ready. First of all, you should have enough knowledge about what is Steam and why Steam Account required? Why Steam Account Requires? Before jump into password recovery and Login details, let me clear about why Steam Account required? There are several benefits of this Steam Account from where you can easily download PC games as well as software. Though it will be p...