The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SSH Logouts

Discussion in 'General Discussion' started by smachol, Jan 18, 2006.

  1. smachol

    smachol Well-Known Member

    Joined:
    Oct 19, 2001
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    All of a sudden my SSH logins are being disconnected after a certain period of time with no use. To my knowledge I have changed nothing that would cause this and my account is using normal shell access, not jailshell.

    Is there a setting in WHM or elsewhere that controls this? I'm using WHM 10.1.0.

    Any ideas?
     
  2. tuxdesk

    tuxdesk Well-Known Member

    Joined:
    Oct 1, 2005
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    Please ucomment the line LoginGraceTime in /etc/ssh/sshd_config
     
  3. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Anything changed with your SSH client software?

    Most should have a keep alive setting that would prevent a disconnect.
     
  4. smachol

    smachol Well-Known Member

    Joined:
    Oct 19, 2001
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    I'll try this. Thanks. It's currently:

    LoginGraceTime 120

    What does this mean?

    Also there have been. no changes at all to my SSH client (TeraTerm Pro w/SSH).
     
  5. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,052
    Likes Received:
    2
    Trophy Points:
    38
    Location:
    Earth
    LoginGraceTime :- The option LoginGraceTime specifies how long in seconds after a connection request the server will wait before disconnecting if the user has not successfully logged in.

    Refer the url http://www.faqs.org/docs/securing/chap15sec122.html for more info on sshd_config file.
    You can search on Google for such information.
     
  6. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    Mine started this about a month ago, but it was the same time I changed internet providers so I thought it was something to do with that, but now after reading your post I am not sure.

    I would not think this woul dbe it since it is disconnecting after a successful login.

    I am still looking into the puTTy software settings and I found a KeepAlive in the sshd_config but I am still researching it.
     
  7. smachol

    smachol Well-Known Member

    Joined:
    Oct 19, 2001
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    This made no difference. I am still being logged out.
     
  8. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    It's possible that you have the TMOUT variable set. Try this in a root shell:

    set | grep TMOUT

    If it's set with a value (in seconds) before interactive sessions will logout after inactivity. It's usually set in a local .bash_profile
     
  9. smachol

    smachol Well-Known Member

    Joined:
    Oct 19, 2001
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    Good thinking, but no. This is not set. This also happens with every SSH acccount I have which leads me to believe it's a server setting. Again I have not changed anything on the user end, nor have I intentionally changed anything on the server side. I believe a WHM/cPanel upddate changed something since that's the only logical explanation I can find for this problem to start happening suddenly like this.
     
  10. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Shot in the dark - do you have this line "AllowTcpForwarding no" in sshd_config? If so comment it out and restart sshd.
     
  11. smachol

    smachol Well-Known Member

    Joined:
    Oct 19, 2001
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    Thanks or the idea, but there's no setting in /etc/ssh/sshd_config for this.
     
  12. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Okay one last try. :rolleyes:

    What value do you see at /proc/sys/net/ipv4/tcp_keepalive_time?
     
  13. smachol

    smachol Well-Known Member

    Joined:
    Oct 19, 2001
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    7200

    What's this mean? And thanks for the help. :)
     
  14. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Number of minutes to keep alive tcp connections.

    Only other suggestion I would have at this point, which doesn't address the issue directly, is to try turning on "KeepAlive" in sshd_config and restart sshd.

    Don't see in your original post anything about OS version or exactly how long you are connected before being bumped. That information may help someone else on the forum with more knowledge of ssh suggest a resolution.
     
  15. smachol

    smachol Well-Known Member

    Joined:
    Oct 19, 2001
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    KeepAlive is already enabled. I'm running Fedora i686 on the server (not sure how to tell more) and Windows XP Pro on my PC.

    Again this happened all of a sudden with no changes on my part. The user rhenderson is reporting the same problem so I still think it's likely this is due to some WHM/cPanel update changing something. And there does not seeem to be a set time before I'm logged out. I'm not at my PC 24/7 so I may leave for a while and when I come back an hour or two later I'm disconnected.

    To reiterate, this just started happening a couple of weeks ago. There have been no changes to my SSH client (TeraTerm Pro) or anything on my PC.

    I do appreciate the efforts to help. :)
     
  16. rbreve

    rbreve Registered

    Joined:
    Nov 19, 2002
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Im having the same problem.

    I checked this http://www.openssh.com/faq.html#2.12

    I tried that but I keep getting disconnected. :mad:
     
  17. smachol

    smachol Well-Known Member

    Joined:
    Oct 19, 2001
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    I'm trying this now. I set:

    ClientAliveInterval 120

    ...and restarted SSH. I let you know if it works for me.
     
  18. smachol

    smachol Well-Known Member

    Joined:
    Oct 19, 2001
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    So far one thing that doesn't work is:

    tail -f /var/log/messages

    This used to update with any new activity but since this problem started it does not - even when the connection is still open.
     
  19. smachol

    smachol Well-Known Member

    Joined:
    Oct 19, 2001
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    Nope - didn't work. This is very frustrating.
     
  20. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Couple more thoughts.

    Check this for a variation on what rbreve suggested.
    http://marc.theaimsgroup.com/?l=openssh-unix-dev&m=112984229231910&w=2

    What version of Fedora? Look in /etc/fedora-release.

    Also what version of openssh? rpm -qv openssh at the prompt.

    If none of that goes anywhere you can either PM your config or put it on pastebin.com if you want someone to check. At this point suspect Fedora bug as it is in constant development and not nearly as stable as CentOS for instance.
     
Loading...

Share This Page