Article Title: force the login user to be kicked off in linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
View users logged on to the machine
[Root @ sunsyk ~] # W
16:29:02 up 2 days, 5 users, load average: 0.03, 0.05, 0.01
User tty from login @ IDLE JCPU PCPU WHAT
Root pts/1: 0.0 Tue15 2 days 0.04 s-bash
Root pts/2: 0.0 Tue15 46: 42 m 0.05 s 0.05 s bash
Root pts/3: 0.0 Tue15 2 days 0.02 s 0.02 s bash
Root pts/4 172.20.52.114 58: 48 0.16 s 0.03 s sqlplus
Root pts/5 172.20.52.114 0.00 s 0.03 s w
I kicked out pts/1 (only the root user can kill the user)
[Root @ sunsyk ~] # Pkill-kill-t pts/1
[Root @ sunsyk ~] # Pkill-kill-t pts/2
[Root @ sunsyk ~] # Pkill-kill-t pts/3
Check whether it is kicked out.
[Root @ sunsyk ~] # W
16:34:16 up 2 days, 2 users, load average: 0.00, 0.05, 0.02
User tty from login @ IDLE JCPU PCPU WHAT
Root pts/4 172.20.52.114 1: 04 m 0.16 s 0.03 s sqlplus
Root pts/5 172.20.52.114 0.00 s 0.03 s w
Root can kill other users, including themselves.