1) Edit /etc/ssh/ssh_config and add: 

ServerAliveInterval 5

2) reload ssh:

sudo service ssh reload      

3) What does it do?:
The client will send every 5 seconds a small keep-alive packet to the server in order to use ssh connection.