CentOS实现一段时间后Shell自动登出非活动用户

认情况下Shell是不会超时自动登出的,但有时需要让它一段时间后在没有操作的情况下自动退出终端。

1、创建文件/etc/profile.d/autologout.sh

# vim /etc/profile.d/autologout.sh

TMOUT=10

readonly TMOUT

export TMOUT

备注:TMOUT的值表示的是超时时间,以秒为单位

2、重新登录或重启系统:# logout

3、10秒钟后Shell无任何操作就自动登出

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native