linux查看和关闭登录到系统的终端

版权声明:转载请注明作者和出处! 作者QQ 152910000 https://blog.csdn.net/icodestechnology/article/details/90055637

列出当前登录到系统的用户

who

root@ubuntu:/# who  
root     pts/0       2017-03-01 09:51 (192.168.3.151)  
root     pts/1       2017-03-01 18:27 (192.168.3.129)  
root     pts/2       2017-03-01 18:27 (192.168.3.144)  
root     pts/3       2017-03-01 18:27 (192.168.3.151)  

关闭某一登录到系统的用户

fuser -k /dev/pts/用户ID

root@ubuntu:/# fuser -k /dev/pts/3   /dev/pts/3:          9339

查看当前登录的用户

tty

root@ubuntu:/# tty  
/dev/pts/1 

没有更多推荐了,返回首页