In Linux, run the pkill command to kick out the online logon User:
Linux is a multi-user and multi-task operating system. Users can connect to Linux servers through SSH in different places.WCommand to view the current online login user.
03:05:23 up 19 min, 3 users, load average: 0.00, 0.03, 0.05
User tty from login @ idle jcpu pcpu what
Root pts/0 192.168.0.2 3.67 s 3.43 S/usr/bin/perl
Root pts/1 192.168.0.31 0.00 s 0.20 s 0.02 s w
Root pts/2 192.168.0.23 052 2.00 s 0.08 s 0.08 s-Bash
As you can see, three users have logged on to the server. Next, use the Who am I command to check that it is your logon terminal, and the following is pts/1.
[Root @ centos ~] # Who am I
Root pts/1 (192.168.0.31)
Next, run the pkill command to kick out the target user.
[Root @ centos ~] # Pkill-kill-T pts/2
Run the W command to check whether the PTS/2 terminal user has been kicked out.
[Root @ centos ~] # W
03:07:28 up 21 min, 2 users, load average: 0.00, 0.02, 0.05
User tty from login @ idle jcpu pcpu what
Root pts/0 192.168.0.2 3.68 s 3.44 S/usr/bin/perl
Root pts/1 192.168.0.31 045 0.00 s 0.23 s 0.01 s w view current Login User
Who
Who-u
Who-Q
Who-I
Who-T
Finger
Last view the historical logon list