ssh -o ServerAliveInterval=60 -i Firstme.pem [email protected]
#Add these lines on sshd_config ClientAliveInterval 120 ClientAliveCountMax 720