auto-logout in linux
来源:互联网 发布:万方数据库检索报告 编辑:程序博客网 时间:2024/05/16 13:06
Almost everyone (not just system administrators) are forgetful and used to leave the Linux/Unix login session open (without logging out).
So, how to make sure all the Linux servers will automatically logout users after idle for certain minutes?
Don’t worry. There is no tedious configuration or additional package to be installed to make this happen.
In fact, the simplest way is to configure the TMOUT environment variable!
For example, this export command
export TMOUT=60
will immediately get the Linux OS to automatically logout an user after his/her login session being idle for 60 seconds or 1 minute!
The TMOUT environment variable is applied to a command line console login session only.
For X-window or GUI login, you can easily turn on any pretty auto-lock screen-saver, that works very much like those in Windows.
For testing purpose, you can set a lower limit. While login to Linux, su to another user ID and execute
export TMOUT=10
After being idle for 10 seconds, you’ll likely see this warning message appears and the su login session will be terminated or log out immediately.
timed out waiting for input: auto-logout
In order the apply TMOUT to all Linux login accounts, you can put that export command to the login scripts or login profile (.bash_profile or .profile) in respective user home directory.
But, the easiest way is to write the export command in the system profile instead of respective user’s profile!
That’s to say, you can append the export TMOUT=60 command to /etc/profile (i.e. the system profile)!
Bear in mind that any login user can simply overwrite this TMOUT setting!
For example, he or she can easily disable or extend the time-out value before auto-logout feature triggered. To disable the Linux auto-logout user feature, just set the TMOUT to zero, i.e.
export TMOUT=0
In addition, the Linux TMOUT environment variable will not effective if the user has an active or open document. For example, if the VI editor is open, the Linux auto-logout feature in command console will not working!
详细请参考:http://www.codesky.net/article/201111/132768.html
- auto-logout in linux
- Changing the Auto-Logout Timeout in SSH
- About the logout in weblogic
- Logout
- Linux命令之exit,logout
- connection timed out waiting for input: auto-logout
- Linux 下 Login 和 Logout 详解
- LinuxStudyNote(35)-Linux退出登录命令logout
- Auto variable in C++
- Auto-vectorization in GCC
- Auto-vectorization in GCC
- Auto Generate Sequence in ClientDataSet
- Auto Completion in SE38 Editor
- Change auto-renaming in guake!!!!!!!!!!!!!!!!!!!!
- Auto refresh images in HTML
- 菜鸟的Linux学习笔记之命令logout
- Linux 关机重启命令(logout/shutdown/reboot)
- linux常用命令(logout,alias,clear,history,wc)
- 【操作系统笔记】进程与线程的区别和联系
- foxmail无法连接zimbra中的POP3端口110来收取邮件
- ASP.NET支持多语言
- Android上下文
- AIXsmit工具
- auto-logout in linux
- loadView与viewDidLoad不同
- js 获取时间:年 月 日 时 分 秒
- 神奇的linux:多线程的实现
- 先有蛋还是先有鸡?互联网的线上线下
- Nosql数据库教程之初探MongoDB - 第一部分
- keil的51单片机仿真调试中如何查看内存的内容
- JDBC之ResultSet用法
- js 弹出框 返回值到父页面的输入框