ssh connection always gets disconnected

Last week, when i came back from lunch all my ssh connection has been terminated. It does not show any error message and won’t respond to any command. I tried pressing enter and ctrl+c but to no avail. This problem will be very annoying when you need to copy a file via scp and in the middle of the process the connection dropped or you are executing a long process and you forgot to put it under a screen

it seems ssh is not sending signals to keep the connection alive or the interval is too long that the connection timed out. To remedy this you need to edit your ssh_config

sudo vim /etc/ssh/ssh_config

and add this line to keep your ssh connection alive

ServerAliveInterval 5

Leave a Reply

Your email address will not be published. Required fields are marked *