Prevent SSH from disconnecting

If you are working with your server, ex: sending some file now and then with SSH, you can experience some annoying connection losses. Actually, if SSH has been idle for a while the connection will be closed.

You can prevent this easily adding a config file with just 2 lines of code to your .ssh folder in your home.

nano ~/.ssh/config
Host *
    ServerAliveInterval 30

Note: in Ubuntu TCPKeepAlive is active by default.