LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1168|回复: 10

怎样用root用户终止其他用户的登陆?

[复制链接]
发表于 2006-4-2 21:32:12 | 显示全部楼层 |阅读模式
如题,怎样强行终止其他用户的登陆,并释放该用户的所有进程?
 楼主| 发表于 2006-4-3 14:21:41 | 显示全部楼层
问题已解决:kill掉该用户的bash进程或者sshd进程即可
回复 支持 反对

使用道具 举报

发表于 2006-4-4 00:02:05 | 显示全部楼层
another way,
  1. fuser -k /home/username
复制代码
回复 支持 反对

使用道具 举报

发表于 2006-4-4 22:41:03 | 显示全部楼层
Post by yongjian
another way,
  1. fuser -k /home/username
复制代码


To yongjian:

yongjian兄这样做是不是通过kill掉那个用户的shell来kill掉他所有的子进程而达到目的吗?
如果用户利用nohup的话,同样可以达到效果吗?

因为对nohup命令不确定,小弟也试了一下,想确认一下,我这里好像也被kill掉了
回复 支持 反对

使用道具 举报

发表于 2006-4-4 22:44:17 | 显示全部楼层
Post by yongjian
another way,
  1. fuser -k /home/username
复制代码


To yongjian:

yongjian兄这样做是不是通过kill掉那个用户的shell来kill掉他所有的子进程而达到目的吗?
如果用户利用nohup的话,同样可以达到效果吗?

因为对nohup命令不确定,小弟也试了一下,想确认一下,我这里好像也被kill掉了
回复 支持 反对

使用道具 举报

发表于 2006-4-4 23:56:16 | 显示全部楼层
NAME
       fuser - identify processes using files or sockets
利用文件或者套接子识别进程,请教他fuser -k kill掉的是哪个进程?或者是哪个文件呢?
回复 支持 反对

使用道具 举报

发表于 2006-4-5 13:22:38 | 显示全部楼层
Post by webyuhang
NAME
       fuser - identify processes using files or sockets
利用文件或者套接子识别进程,请教他fuser -k kill掉的是哪个进程?或者是哪个文件呢?


就是identify出来的进程亚
回复 支持 反对

使用道具 举报

发表于 2006-4-5 23:48:56 | 显示全部楼层
fuser kills all open sockets, file handlers under a given name. The example I show is to stop any programs that open files under /home/username, which will completely logoff the user. If you want to see what have been killed.
  1. lsof /home/username
复制代码
回复 支持 反对

使用道具 举报

发表于 2006-4-6 15:21:14 | 显示全部楼层
Post by yongjian
fuser kills all open sockets, file handlers under a given name. The example I show is to stop any programs that open files under /home/username, which will completely logoff the user. If you want to see what have been killed.
  1. lsof /home/username
复制代码


To yongjian兄:
我有个问题,如果我们杀死了父进程,是否其下的子进程都会被杀死,还是有可能会产生那种zombie进程?
回复 支持 反对

使用道具 举报

发表于 2006-4-6 15:54:35 | 显示全部楼层
skill -KILL -v /dev/pts/*   
Kill users on new-style PTY devices
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表