Open Ssh Connection



SSH Timeouts

When using default configuration on Ubuntu, you might experience SSH Timeouts (i.e. the console you are using to connect to a remote server will seem to freeze) after a few minutes of lack of activity.

In this tutorial, you will know causes for the SSH Connection Refused problem and soutions for all of them, step by step. Also, how to debug SSH connection. I need an sftp windows client and I just installed Bitvise. My windows 10 version runs on Parallels (version 10) on a Mac (OS X Yosemite version 10.10.5). As a test, I tried to open an ssh connection.

This is annoying because you need to open a new console instance and reconnect and perform any other steps you need before connecting.

Since using SSH to connect to remote servers is very common and linux being as old as it is, you would think that someone somewhere would have provided a solution for this problem by now; you'd be right.

Configuration

To increase the time a connection stays open you need to add configuration both to the client and the server

Client side

In the server/computer you are connecting from

OpenOpen ssh connection ubuntuOpen Ssh Connection

Open file /etc/ssh/ssh_config and set directive ServerAliveInterval to a value like 60:

Open Ssh Connection Robot Framework

This causes your SSH client to send keep-alive messages every 60 seconds so that the server doesn't drop your connection.

Server-side

In the server you are connecting to

You must also configure the SSH remote Server you are connecting to.

Open file /etc/ssh/sshd_config and add these configurations1 at the end of the file.

Restart the ssh server so that changes take effect:

Footnotes

Openssh

1: These are conservative settings that will make your SSH Server disconnect after (600 * 10 = 6000) seconds of user inactivity. Customize these if you need more.