[Email protected] ~]# W
01:52:52 up min, 3 users, load average:0.00, 0.02, 0.05
USER TTY from [email protected] IDLE jcpu PCPU
Root pts/0 172.16.30.204 01:39 6:52 3.67s 3.43s/usr/bin/python
Root pts/1 172.16.30.204 01:45 0.00s 0.20s 0.02s W
Root PTS/2 172.16.30.204 01:52 2.00s 0.08s 0.08s-bash see that there are two users connected to the main machine, then use who am I to see the end of their landing, the following is PTS/1 [email protected] ~]# who am I
Root PTS/1 2008-05-07 01:45 (172.16.30.204) then use the Pkill command to kick out the user who wants to kick out.
[email protected] ~]# pkill-kill-t PTS/2Then use W to view the current user, you can see that the PTS/2 has been given to dry off
[Email protected] ~]# W
01:53:28 up min, 2 users, load average:0.00, 0.02, 0.05
USER TTY from [email protected] IDLE jcpu PCPU
Root pts/0 172.16.30.204 01:39 7:28 3.68s 3.44s/usr/bin/python
Root pts/1 172.16.30.204 01:45 0.00s 0.23s 0.01s W
"Linux" Pkill kicks online users