Install ssh server sudo apt-get update -y sudo apt-get install openssh-server Add this in the end of file /etc/ssh/ssh_config TCPKeepAlive yes ClientAliveInterval 3600