When ssh connection drops out after a few minutes of inactivity

This is the error message it displays:

… send disconnect: Broken pipe

Solution:

In /etc/ssh/sshd_config, make sure these two lines are uncommented:

ClientAliveInterval 30
ClientAliveCountMax 5