How to Set idle SSH connection timeout disconnection in solaris10

Source: Internet
Author: User

There are two parameters in the SSH configuration file to control idle connection timeout and disconnection. The two parameters are clientalivecountmax and clientaliveinterval.

Set idle SSH connection timeout on solaris10 as follows:


Modify the/etc/ssh/sshd_config file and add the following content to the file: clientalivecountmax = 0 clientaliveinterval = 600 # The unit is seconds and then restart the SSH service: #> svcadm restart SSH

For more information about the two parameters, see man sshd_config.

ClientAliveCountMax         Sets the number of client  alive  messages  (see  Clien-         tAliveInterval,  below)  that  can  be sent without sshd         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  KeepAlive         (see  below). The client alive messages are sent through         the encrypted channel and therefore will not be  spoofa-         ble.  The  TCP  keepalive option enabled by KeepAlive is         spoofable. The client alive mechanism is valuable when a         client or server depend on knowing when a connection has         become inactive.         The default value is 3. If  ClientAliveInterval  (below)         is  set  to  15,  and ClientAliveCountMax is left at the         default, unresponsive ssh clients will  be  disconnected         after approximately 45 seconds.     ClientAliveInterval         Sets a timeout interval in seconds after  which,  if  no         data  has  been  received  from the client, sshd sends 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. This         option applies only to protocol version 2.
It should be noted that the description in man seems to be wrong. According to the instructions in man, if clientalivecountmax is set to 3 and clientaliveinterval is set to 15, the idle connection should be automatically disconnected in about 45 seconds. However, clientalivecountmax must be set to 0 in actual tests, idle connections can be automatically disconnected.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.