I like using CentOS on my servers and desktop machine. After I start using, my ssh connections terminate so quickly if I do not type anything at terminal in a few minutes, may be seconds. It is very annoying when you loose a active connection.

The message is

Write failed: Broken pipe

The situation is very annoying. Hence I find a workaround for this problem. .ssh/config tricks help me prevent this problem. The reason of the problem is keep alive messages. These messages are used for indicating if the connection is still in use. After Centos 7 installation ssh client’s keep alives have this problem. The setting about this problem is ServerAliveInterval. When typing connection parameters, if we set this parameter to 10 (seconds), we won’t get timeouts. The tricks is at setting the value at ./ssh/config file. This file is user manageable and no needs any root permissions. An example is:

Host *
ServerAliveInterval 10

You should write these two lines at the top of the configuration file to satisfy inheritance.

And, voilà!. There is no timeouts and broken pipelines.