日期:2014-05-16  浏览次数:20661 次

solaris 用户自动退出登录
系统是solaris的,里边有许多用户,root用户或者其他用户登录的时候,设置一个时间,等超过多久不使用的时候自动断开连接,连接是telnet
------解决方案--------------------
To implement a 15-minute idle time-out for the default /bin/bash shell, create a new ?le tmout.sh in the
directory /etc/profile.d with the following lines:
TMOUT=900
readonly  TMOUT
export  TMOUT
To implement a 15-minute idle time-out for the tcsh shell, create a new ?le autologout.csh in the directory
/etc/profile.d with the following line:
set  -r  autologout  15
Similar actions should be taken for any other login shells used.

这是在rhel5上的一种做法,你可以试试看有没有效果。
------解决方案--------------------
那单独在root用户的各种shell登录profile文件里设置诸如TMOUT的环境变量或者相应的执行语句吧

各种shell的初始化文件网上随便都能搜索到的,我这里贴的格式可能看起来有点乱,你自己也可以找找的。

6种shell的初始化文件:
======================================================================
SHELL类别      系统大环境初始化文件     用户初始化文件             SHELL路径
----------------------------------------------------------------------------------------------------
Bourne          /etc/profile                          $HOME/.profile              /bin/sh
Korn              /etc/profile                          $HOME/.profile              /bin/ksh
C                   /etc/.login                           $HOME/.cshrc               /bin/csh
Z                   /etc/zshenv                         $HOME/.zshenv             /bin/zsh
                     /etc/zprofile                         $HOME/.zprofile     
                     /etc/zshrc                            $HOME/.zlogin     
                     /etc/zlogin      
BASH