+ -
当前位置:首页 → 问答吧 → solaris 用户自动退出登录

solaris 用户自动退出登录

时间:2011-12-09

来源:互联网

系统是solaris的,里边有许多用户,root用户或者其他用户登录的时候,设置一个时间,等超过多久不使用的时候自动断开连接,连接是telnet

作者: wb4313   发布时间: 2011-12-09

To implement a 15-minute idle time-out for the default /bin/bash shell, create a new file 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 file 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上的一种做法,你可以试试看有没有效果。

作者: askandstudy   发布时间: 2011-12-09

版本不同,solaris 里边没有/etc/profile.d的目录,root 用户是调用的是/sbin/sh

作者: wb4313   发布时间: 2011-12-09

solaris我不熟,但是你可以先随便用一个用户试一下TMOUT有没有效果,有效果的话那就是该把这个TMOUT环境变量放在哪里让它对整个系统生效而又不能被用户修改的问题,这个你得自己google一下了。

作者: askandstudy   发布时间: 2011-12-09

TMOUT 就是没效果呢。。 

  root用户和其他用户还有很大的不同,TMOUT 可以看到有时间设置,但是不产生效果

作者: wb4313   发布时间: 2011-12-09

你用的是什么shell?

作者: askandstudy   发布时间: 2011-12-09

你用PuTTY或者SecureCRT之类的工具,里面有个选项:
keep alive

作者: ljc007   发布时间: 2011-12-09

我前面已经贴了两种类型的shell的做法了,有人说:
In all ,The ksh and bash can use the "TMOUT" to force the user out in a time,The sh and csh can not

作者: askandstudy   发布时间: 2011-12-09

SecureCRT ,中的Anti-idle? 
  我是用来管理root用户,就是说所有用root用户登录的能够自动断开,而不是我自己

作者: wb4313   发布时间: 2011-12-09

用bash试过了,也没效果呢

作者: wb4313   发布时间: 2011-12-09

bash 试过了,可以退出来。
  我是需要就是有人登录在系统,开始不是用bash,但是他一段时间后,我们可以把它登录踢下来

作者: wb4313   发布时间: 2011-12-09

solaris有像这样的环境变量吗?看看

[root@RHEL6A etc]# echo $SHELL
/bin/bash

作者: askandstudy   发布时间: 2011-12-09

比如他用的是其他shell,然后不切换到bash,一段时间后,系统可以自动把它的登录踢掉

作者: wb4313   发布时间: 2011-12-09

什么意思啊?你是想强行把其他用户踢出系统?你1楼不是问的空闲超时的问题吗

作者: askandstudy   发布时间: 2011-12-09

那你就设置其他shell的空闲超时退出,不要设置bash的空闲超时退出就行了

作者: askandstudy   发布时间: 2011-12-09

恩啊,是空闲超时问题,怎么设置其他的shell 空闲超时退出呢

作者: wb4313   发布时间: 2011-12-09

我们/etc/passwd 下边配的是/sbin/sh

作者: wb4313   发布时间: 2011-12-09

连我都糊涂了,呵呵
那你直接修改这个用户的默认shell为bash不就行了,何必要求他先用某种shell登录然后再强制要求别人来切换shell呢

作者: askandstudy   发布时间: 2011-12-09

我们系统root用户,从/etc/passwd里边看到是/sbin/sh 这个是那种shell?
  我们系统的shell是不能改的,如果要设置怎么设置?

作者: wb4313   发布时间: 2011-12-09

热门下载

更多