One of our regular reader hall sends an interesting question:
I work for a small company and most user login to centralized Linux server. I’d like to
automatically log out all inactive users from server for various reasons. How do I disconnect inactive user sessions?
To be frank, I don’t have any clear cut answer to question. There are at least 4-5 shells installed on a typical Linux installation. Also most user have has control over their own environment and user can switch to a different shell.
I hope our reader or seasoned UNIX admin can help to answer this question. Please share the experiences and advice in the comments.
Update: Checkout answer below in comments!
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop









{ 3 comments… read them below or add one }
you can do this in sshd_config file:
Set idle session timeout to 15 min:
ClientAliveInterval 300
ClientAliveCountMax 3
Another way: for bash and Korn-shell, setting
TMOUT=7200in /etc/profile will logout users after 2 hours of inactivity.
Hey I just added three of your articles to fsdaily.com which is a site like digg but for news and article about free software.
Can you please add an “FSD it” link to your list of service links? It’ll make it easier for me (or anyone else) to do it with future articles you write.
The link for this article would be:
URL
Thanks.