Linux system root users can be forced to kick the other login users, first use the $w command to view the logged in user information, display information as follows:
[Email protected] ~]# W
10:01:23 up 1:23, 3 users, load average:0.71, 0.58, 0.57
USER TTY from [email protected] IDLE jcpu PCPU
Root tty2-09:59 1:53 0.01s 0.01s-bash
Root pts/0:0.0 10:01 0.00s 0.03s 0.00s W
Wangbo pts/2 192.168.0.196 09:42 18:50 0.01s 0.01s-bash
[Email protected] ~]#
Force kick Man Command format: pkill-kill-t TTY
Explain:
Pkill-kill-t Kick Man Command
TTY kicked user's TTY
The command to kick out the Liu user as above is: Pkill-kill-t PTS/1
Only the root user can kick people, at least that's what I'm testing. If there are two people logged in with the root user at the same time, any one of them can kick off the other. Any user can kick off their-_-
How to kick off a user with terminal login, such as:
Root pts/0:0.0 10:01 0.00s 0.03s 0.00s W
First, use the command to view the pts/0 's process number, which is the following command:
[Email protected] ~]# Ps-ef | grep pts/0
Root 15846 15842 0 10:04 pts/0 00:00:00 bash
Root 15876 15846 0 10:06 pts/0 00:00:00 ps-ef
Root 15877 15846 0 10:06 pts/0 00:00:00 grep pts/0
Kick off the user's command:
Kill-9 15846
Forced to kick off the login user under Linux system