This happened due to timeout issue. Lets increase the ssh timeout by following the bellow steps
$ sudo vi /etc/ssh/sshd_config
ClientAliveInterval 1200
ClientAliveCountMax 3
Timeout value = ClientAliveInterval * ClientAliveCountMax
1200 seconds * 3 = 3600
ClientAliveInterval 3600
$ sudo systemctl reload sshd