Portal Home > Knowledgebase > VPS Hosting and Dedicated Servers > How to disconnect SSH idle sessions


How to disconnect SSH idle sessions




This example set the maximum time to 15 minutes idle, so open sshd_config file with your favorite text editor as root. In our case vi:

vi /etc/ssh/sshd_config

And be sure this options are set:

ClientAliveInterval 900
ClientAliveCountMax 0

This way after 900 seconds, the ssh session will be terminated, with no keep alive package even being sent. You may adjust the idle time with ClientAliveInterval, set it in seconds to the time you think is enough for your users.

Also be sure the parameter is enabled:

TCPKeepAlive yes



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Buy VPS with Paysafecard (Views: 12175)

* Minimum sign up periods for cPanel Web Hosting plans: Mini - 3mo., Pro - 1mo., Biz - 1mo., cPanel Reseller Hosting, Linux VPS, Windows VPS, Managed cPanel VPS and Dedicated Servers - 1mo. secret link
Accepted payments: Credit/Debit Card, Paypal, Payza, Skrill, WebMoney, CashU, Ukash, paysafecard, Bitcoin, Perfect Money, SolidTrust Pay, OKPay, EgoPay, Western Union/MG, Wire Transfer and more.