Increasing the timeout value of ssh using mac terminal

Hi All,
I am a little bummed that my SSH connections timeout when they are idle for some time. This is a bigger problem when using Mysql has ben logged in , as I need to put the same login information again which involved copying again from the browser.

Can someone tell me how to increase the timeout period if it is possible from client side if someone has done that ?

I have heard that it is not possible from client side. Can the admin do that from the server side ?
I don’t want to use other methods I am comfortable using the SSH only.
Thanks,

@utkarsh_rathor,

We have setup below two configurations on the server side.

ClientAliveInterval 120
ClientAliveCountMax 5 

Which means that server sends the clients a “null packet” every 120 seconds and not disconnect them until the client has been inactive for 5 intervals. So you will be disconnected after 120*5 = 600 seconds of inactivity.

If you want an even bigger window, then please add below line in your ~/.ssh/config

ServerAliveInterval 120

Do not forget to restart ssh after you have modified your config.

Hope this helps.

Thanks

1 Like