My Notepad

  • My Linux Notes
  • My Grid Notes
  • To do List
  • Saturday, June 10, 2006

     

    OpenSSH idle disconnect Problem

    OpenSSH daemon(sshd) by default will cut client off if the client has been idled for some period.

    There are basically two kinds of solutions, one is from client side. The client can send a dummy packet to ssh server periodically to avoid being recognized as 'idle'. Some ssh client already has this functions built-in, e.g. openssh in Debian and putty. If you are using default openssh client, you probabaly have to patch it with this fuction.

    Another approach is obviously from server side, the sshd. This will only be possbile if you have root priviledge on the server. Because you need to modify the configruration file for sshd, which is /etc/ssh/sshd_config in RedHat Linux.

    Uncomment the following two lines.

    ClientAliveInterval 60
    ClientAliveCountMax 120

    This enable the sshd to send a message to the client every 60 sec to request a response. The sshd wont cut the client off untill 120 messages have been sent to the client and no response was received.

    Note that, the response from client is done by the client program automatically, user on client side doesnt know these details at all.

    Strictly speaking, this is not a good solution, becaue the server will not disconnect the user untill 2 hours after the user has disconnect himself anormally, e.g. close the terminal without loging out. But this solution avoids the client been cut off simply because of idle status.

    More details available at man page of sshd_config:
    man sshd_config

    Comments: Post a Comment



    << Home

    Archives

    December 2005   January 2006   February 2006   April 2006   May 2006   June 2006   July 2006   November 2006   February 2007   May 2007   June 2007   November 2007   February 2008   March 2008   April 2008   August 2008   December 2008   March 2009   April 2009   May 2009   June 2009   October 2009   November 2009   December 2009   May 2013  

    This page is powered by Blogger. Isn't yours?