有些用户下班也不退出,怎么才能自动logout用户呢?谢谢!
ibm里可以,不知道5.1a可不可以。
lxlab 回复于:2004-08-15 22:49:47 |
哦?没人给个建议呀? |
hahaer 回复于:2004-08-16 14:47:08 |
在用户的 .profile里面定义 TMOUT
试试! 以前做过的 |
江洋大盗 回复于:2004-08-16 21:37:11 |
好象管理员在定制用户的时候有一项是用户闲置多长时间就自动退出(也可能是
SCO里有这个功能),试一下,别忘了告诉我结果。 |
lxlab 回复于:2004-08-16 21:53:09 |
加用户的时候是定义不了的呀。
EXAMPLES: Enter a login name for the new user (for example, john): chris Enter a UID for (chris) [5006]: Enter a full name for (chris): Chris Ryan Enter a login group for (chris) [users]: Enter another group that (chris) should be a member of. (<Return> for none): Enter a parent directory for (chris) [/usr/users]: The shells are: /bin/sh /bin/csh /bin/ksh Enter a login shell for (chris) [/bin/sh]: Adding new user ... Do you wish to edit the auth file entry for this user (y/[n])? You must enter a new password for (chris). Changing password for chris. New password: Retype new password: .profile 的方法还没试呢,试完再发过来。谢谢! |
江洋大盗 回复于:2004-08-16 22:09:02 |
加用户的时候是定义不了的呀。
EXAMPLES: Enter a login name for the new user (for example, john): chris Enter a UID for (chris) [5006]: Enter a full name for (chris): Chris Ryan Enter a login group for (chris) [users]: Enter another group that (chris) should be a member of. (<Return> for none): Enter a parent directory for (chris) [/usr/users]: The shells are: /bin/sh /bin/csh /bin/ksh Enter a login shell for (chris) [/bin/sh]: Adding new user ... Do you wish to edit the auth file entry for this user (y/[n])? 在这里你回答的Y还是N呢? |
lxlab 回复于:2004-08-17 19:09:02 |
n呀 |
飞天二狭 回复于:2004-08-17 19:39:07 |
偶也想实现这个功能,可是不会 |
江洋大盗 回复于:2004-08-17 22:44:55 |
试一下回答Y,完了告诉我 |
hahaer 回复于:2004-08-18 09:56:32 |
TMOUT
为什么不去试一下呢??? |
飞天二狭 回复于:2004-08-18 10:03:01 |
我在LINUX上试过,不好用~ |
hahaer 回复于:2004-08-18 10:13:53 |
你在linux上env能看到TMOUT这个变量吗?
有些linux有的命令在tru64上有吗? linux的shell和tru64的shell就不一样的 |
hahaer 回复于:2004-08-18 10:26:25 |
linux上不行,不能说明问题吧
linux用的shell (bsh) 和tru64上的不一样 (sh) 我在hpux上做过实验,在tru64上env看到有这个变量。 |
hahaer 回复于:2004-08-18 10:28:34 |
linux上不行,不能说明问题吧
linux用的shell (bsh) 和tru64上的不一样 (sh) 我在hpux上做过实验,在tru64上env看到有这个变量。 |
我爱臭豆腐 回复于:2004-08-18 21:13:14 |
# adduser
Enter a login name for the new user (for example, john): test1 [color=green:db8d76582f] //输入用户名[/color:db8d76582f] Enter a UID for (test1) [16]: Enter a full name for (test1): test1 Enter a login group for (test1) [users]: Enter another group that (test1) should be a member of. (<Return> only if none): Enter a parent directory for (test1) [/usr/users]: /home/test1 /home/test1 was not found, do you want to create it ([y]/n)? y The shells are: /usr/bin/sh /usr/bin/ksh /bin/sh /bin/ksh /usr/bin/csh /usr/bin/posix/sh /bin/csh Enter a login shell for (test1) [/bin/sh]: /bin/csh [color=green:db8d76582f]//选择csh [/color:db8d76582f] Adding new user... You must enter a new password for (test1). Changing password for test1. New password: Retype new password: Hashed database not in use, only /etc/passwd text file updated. Finished adding user account for (test1). # cd /home/test1/test1/ [color=green:db8d76582f]//进入home目录[/color:db8d76582f] # vi .cshrc [color=green:db8d76582f]//编辑这个文件加入下面这一行:[/color:db8d76582f] setenv autologout 1 存盘退出 # vi .login [color=green:db8d76582f]//编辑这个文件加入下面这一行:[/color:db8d76582f] set autologout=1 存盘退出 然后使用test1这个用户登陆,检测环境变量是否配置正确: alpha> env PATH=/home/wh/wh/bin:/usr/bin:. TERM=vt100 LOGNAME=wh USER=wh SHELL=/bin/csh HOME=/home/wh/wh SHLVL=1 MAIL=/usr/spool/mail/wh autologout=1 alpha> 这样就大功告成了:) 希望这个对你们有所帮助. alpha> uname -a OSF1 alpha V4.0 1229 alpha alpha> 我爱臭豆腐 2004-08-18 21:13 :em02:[color=#444444:db8d76582f][/color:db8d76582f][color=#444444:db8d76582f][/color:db8d76582f][color=#444444:db8d76582f][/color:db8d76582f][color=#444444:db8d76582f][/color:db8d76582f][color=#444444:db8d76582f][/color:db8d76582f] |
飞天二狭 回复于:2004-08-18 21:18:21 |
好啊,不错,明天我就试试。 |
我爱臭豆腐 回复于:2004-08-18 21:21:00 |
:P
这个是我偷偷使用人家机器实验的 :em18: |
飞天二狭 回复于:2004-08-18 22:06:18 |
上面的方法是退用户吧。另外,有些用户,开了很多xterm窗口,几天都不用,能不能实现,自动退xterm窗口的功能呀! |
jiatb 回复于:2004-08-18 23:27:40 |
哦? |
lxlab 回复于:2004-08-18 23:31:12 |
呵呵,好使! 我试了,5.1a 在.login 里加上 set autologout=1 一分钟后就自动退出了。非常感谢!!! |
lxlab 回复于:2004-08-18 23:36:22 |
在.profile中定义TMOUT也好使,不过在用户登陆的时候就会提示在多少秒后将自动退出! |
dong_jh 回复于:2004-08-19 10:29:50 |
要不在登录的控制台设备上定义,如IBM的tty设备,TRU64叫什么就不知道了。 |
江洋大盗 回复于:2004-08-19 11:06:05 |
想让别人的xterm 窗口自动退出可能有难度,但我相信限制他打开窗口的数量也许通过努力可以实现. |
飞天二狭 回复于:2004-08-19 11:16:47 |
我实验成功了!有兴趣的可以试试!非常好呀,我要给它应用到实际工作中,谢谢你,豆腐! |
我爱臭豆腐 回复于:2004-08-19 11:42:38 |
:P 谢谢你的提示.我确实是写错了一个地方. :oops: 希望这个东西对你们有用这样我就没有白实验:) |
czyf2001 回复于:2004-08-19 18:00:59 |
只能选用/bin/csh 啊? csh下成功!
谢谢豆腐大哥了!嘿嘿! 但: 我试验了/bin/ksh不行啊! |
lxlab 回复于:2004-08-19 20:23:26 |
哦?我试了,ksh下是可以的,按楼上所说的作,完全可以实现的。在.profile中定义TMOUT=1 然后就可以了,登录后就会提示你60秒后自动退出。别忘了更改passwd中的设置,设置成ksh为默认shell,就可以了! |
bluerain20 回复于:2004-08-19 22:57:23 |
也遇到过这样的问题
我一般都是 kill -9 -1 将相同用户都杀掉,然后再进来 |
我爱臭豆腐 回复于:2004-08-20 10:45:16 |
:P 实际上是不管在什么系统里面要知道所用的shell里面关于自动退出的变量怎么设置就完事了. |
我爱臭豆腐 回复于:2004-08-20 10:47:48 |
bash:
TMOUT If set to a value greater than zero, TMOUT is treated as the default timeout for the read builtin. The select command termi- nates if input does not arrive after TMOUT seconds when input is coming from a terminal. In an interactive shell, the value is interpreted as the number of seconds to wait for input after issuing the primary prompt. Bash terminates after waiting for that number of seconds if input does not arrive. |
czyf2001 回复于:2004-08-20 12:55:24 |
在ksh下,查看了ksh的帮助!
在.profile中增加了: TMOUT = 1 新开一个终端后,总是报告60秒之后退出! 我不想让它总是这样报告,该怎么办? 在.cshrc和.login中设置还是不行啊◎ |
lxlab 回复于:2004-08-20 21:51:06 |
对,它是一直总报告的,目前还没有办法。不过用csh,在.login设置是可以的呀,你新建一个用户,修改。login试试。 |
lxlab 回复于:2004-08-22 23:18:21 |
用csh就不会报了。 |
lxlab 回复于:2004-08-24 20:37:06 |
呵呵,看来这个问题有好多人在关注呀! |
我爱臭豆腐 回复于:2004-08-25 18:57:57 |
[quote:e81f6db51a="lxlab"]呵呵,看来这个问题有好多人在关注呀![/quote:e81f6db51a]
这是一个不错的开始.希望能够保持下去. |
lxlab 回复于:2004-08-25 20:08:58 |
呵呵,谢谢老大!这也是工作需要才提出来的!感谢大家的支持! |
lxlab 回复于:2004-09-14 18:38:32 |
ding一下! |
timekiller_bt 回复于:2005-05-25 09:21:46 |
Digital UNIX V4.0F (Rev. 1229); Tue Dec 30 19:02:16 CST 2003
ds 20的机器。偶也试过了修改.login文件。还是行不通啊。我一般用root登陆,就是修改这个用户的logout方式。高手帮忙啊! |
我爱臭豆腐 回复于:2005-05-25 16:19:20 |
你使用的是什么shell阿? |
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/