linux 踢出其他用户,Linux查看当前登录用户并踢出用户
1、查看當前登錄用戶
[root@94ip?~]$?whatis?w
w?????(1)?-?Show?who?is?logged?on?and?what?they?are?doing
[root@94ip?~]$?w
09:49:30?up?1?day,?17:19,?4?users,?load?average:?0.00,?0.00,?0.00
USER??TTY??FROM????LOGIN@?IDLE?JCPU?PCPU?WHAT
root??tty3??-????09:25?23:25?0.10s?0.08s?-bash
root??pts/0?192.168.105.188?09:32?9:38?0.02s?0.02s?-bash
root??pts/1?192.168.105.188?09:36?9:32?0.03s?0.02s?-bash
wilsh?pts/2?192.168.105.188?09:41?0.00s?0.00s?0.00s?w
2、踢出當前在線的用戶
a)pkill
[root@94ip?~]$?whatis?pkill
pkill?[pgrep]??(1)?-?look?up?or?signal?processes?based?on?name?and?other?attributes
[root@94ip?~]$?pkill?-KILL?-u?wilsh?#-u用來指定用戶名
[root@94ip?~]$?pkill?-9?-u?wilsh?#?-KILL?-9都是可以的。
[root@94ip?~]$?pkill?-KILL?-t?pts/2
[root@94ip?~]$?pkill?-KILL?-t?/dev/pts/2
b)skill
[root@94ip?~]$?whatis?skill
skill
(1)?-?send?a?signal?or?report?process?status
[root@94ip?~]$?skill?-9?-t?pts/2
[root@94ip?~]$?w
09:57:37?up?1?day,?17:28,?4?users,?load?average:?0.00,?0.00,?0.00
USER??TTY??FROM????LOGIN@?IDLE?JCPU?PCPU?WHAT
root??tty3??-????09:25?31:32?0.10s?0.08s?-bash
root??pts/0?192.168.105.188?09:32?17:45?0.02s?0.02s?-bash
root??pts/1?192.168.105.188?09:36?17:39?0.01s?0.01s?-bash
wilsh?pts/2?192.168.105.188?09:57?0.00s?0.00s?0.00s?w
[root@94ip?~]$?skill?-9?-u?wils
總結
以上是生活随笔為你收集整理的linux 踢出其他用户,Linux查看当前登录用户并踢出用户的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 盛京银行和恒大什么关系 恒大是盛京银行的
- 下一篇: tensorflow运行环境linux,