In this article, we will see a common error message and how to get rid of this in linux.
I. Error Message
Error: EXIT:  STDERR: [Array (  => Connection to ngelinux001 closed by remote host. ) ]
2. Make TCP Keep Alive “Yes” and Set Alive Interval to 30 seconds.
[saket@ngelinux001 ~]$ cat .ssh/config TCPKeepAlive yes ClientAliveInterval 30
Now when you logout and login back again, the connection will be made using these options.
And your session will not be closed automatically by remote host.
Similarly we can prevent ssh/scp session to stuck by using options like below.