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.
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.
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:
- Use your preferred text editor to open the ~/.ssh/config file on your local computer.
- If the .ssh directory or the config file do not exist, create them.
- 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
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
Post a Comment