由于linux服务器允许多用户登录,公司很多人知道密码,工作造成一定的障碍所以需要有时踢出指定的用户
1/#who 查出当前有那些终端登录(用 w 命令更详细)
# who
root pts/0 2010-10-28 09:36 (192.168.1.236)
root pts/2 2010-10-28 09:40 (192.168.1.27)
root pts/3 2010-10-28 10:02 (192.168.1.82)
root pts/4 2010-10-20 16:06 (192.168.1.244)
2/我想踢出IP为82的登录,其对应的tty为pts/3
# pkill -kill -t pts/3
3/再次查看
# who
root pts/0 2010-10-28 09:36 (192.168.1.236)
root pts/2 2010-10-28 09:40 (192.168.1.27)
root pts/4 2010-10-20 16:06 (192.168.1.244)
已成功踢出
阅读(1428) | 评论(0) | 转发(0) |