Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have set up an automatic logout for idle ssh session using "ClientAliveInterval 7200"

However I do not get logged out everyone else who uses the server gets logged fine.

I have tracked the trouble maker down to this line in my personal .screenrc

caption always "%{WB}%H %{kG}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{kG}%?%+Lw%? %88=%{YR}%M%d %94=%{RY}%c%="

Does anyone know why this would stop the logout from working?

Is there a better automatic logout setting I can use that cannot be overridden?

I am using FreeBSD 8.0

share|improve this question

2 Answers 2

up vote 0 down vote accepted

ClientAliveInterval does not logout idle connections. It checks if the client is still connected at all (like a TCPKeepAlive, but encrypted). If the client responds to these requests (default for Putty, not for most *nix ssh) then the connection will stay open indefinitely.

If you want idle users logged out you need to do that through the shell. For Bash, Ksh, & Zsh add export TMOUT=7200 to the rc file.

share|improve this answer
    
but if I use TMOUT and have say 3 screens open it logs out the first screen after 7200 seconds then the second screen after another 7200 second and so on until it finally logs all the screens out. which is not really what I am going for. –  Alistair Prestidge Jul 16 '10 at 13:48
    
There's no way in SSH to kill the connection when it's idle while the client is responding to those keepalives. If you disable keepalives in the SSH client, you'll get booted after the 7200; but if anyone re-enables them it wont work anymore. –  Chris S Jul 16 '10 at 14:11
    
OK thanks for the help. That is what I was dreading the answer to be. –  Alistair Prestidge Jul 19 '10 at 16:35

So I am guessing no one has had this issue before I cannot find any reason for this and I cannot find a way around this issue with some other automatic logout option. bash's TMOUT does not work as it logs each screen out one at a time.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.