{"id":3372,"date":"2020-05-22T11:56:16","date_gmt":"2020-05-22T16:56:16","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=3372"},"modified":"2020-05-22T11:56:28","modified_gmt":"2020-05-22T16:56:28","slug":"how-to-increase-session-timeout-for-ssh","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/how-to-increase-session-timeout-for-ssh\/","title":{"rendered":"How To Increase Session Timeout for SSH"},"content":{"rendered":"\n<p>From the server side, edit the \/etc\/ssh\/sshd_config<\/p>\n\n\n\n<p>Change, uncomment, or add<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ClientAliveInterval 120<br>ClientAliveCountMax 15<\/pre>\n\n\n\n<p>Change the AliveInterval and CountMax as desired.  <\/p>\n\n\n\n<p>More info on the AliveIntercal and CountMax.<\/p>\n\n\n\n<p><a href=\"https:\/\/man.openbsd.org\/sshd_config#ClientAliveCountMax\"><code>ClientAliveCountMax<\/code><\/a> Sets the number of client alive messages which may be sent without <a href=\"https:\/\/man.openbsd.org\/sshd.8\">sshd(8)<\/a> receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. It is important to note that the use of client alive messages is very different from <code>TCPKeepAlive<\/code>. The client alive messages are sent through the encrypted channel and therefore will not be spoofable. The TCP keepalive option enabled by <code>TCPKeepAlive<\/code> is spoofable. The client alive mechanism is valuable when the client or server depend on knowing when a connection has become unresponsive.<\/p>\n\n\n\n<p>The default value is 3. If <code>ClientAliveInterval<\/code> is set to 15, and <code>ClientAliveCountMax<\/code> is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds. Setting a zero <\/p>\n\n\n\n<p><code>ClientAliveCountMax<\/code> disables connection termination.<a href=\"https:\/\/man.openbsd.org\/sshd_config#ClientAliveInterval\"><code>ClientAliveInterval<\/code><\/a> Sets a timeout interval in seconds after which if no data has been received from the client, <a href=\"https:\/\/man.openbsd.org\/sshd.8\">sshd(8)<\/a> will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client.<\/p>\n\n\n\n<p>More information<br><a href=\"https:\/\/man.openbsd.org\/sshd_config\">https:\/\/man.openbsd.org\/sshd_config<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>From the server side, edit the \/etc\/ssh\/sshd_config Change, uncomment, or add ClientAliveInterval 120ClientAliveCountMax 15 Change the AliveInterval and CountMax as desired. More info on the AliveIntercal and CountMax. ClientAliveCountMax Sets the number of client alive messages which may be sent &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/how-to-increase-session-timeout-for-ssh\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[1025,373,221,1026],"class_list":["post-3372","post","type-post","status-publish","format-standard","hentry","category-linux","tag-client","tag-openssh","tag-ssh","tag-timeout"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/3372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=3372"}],"version-history":[{"count":1,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/3372\/revisions"}],"predecessor-version":[{"id":3374,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/3372\/revisions\/3374"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=3372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=3372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=3372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}