Platform: RHEL5.4
First, run the "w" command to view the logon user information, then run the "pkill-kill-t pts/x" command to kick the user (indicating that the user who uses pkill to send the kill signal to kill the terminal is pts/x and can kick multiple users at the same time ), only root users can play. example:
# W
11:52:49 up 61 days, 5 users, load average: 0.50, 0.49, 0.47
User tty from login @ IDLE JCPU PCPU WHAT
Oracle pts/8 172.16.1.180 25Jul10 37 days 0.08 s 0.07 s rlwrap-s 5000/u01/app/oracle/product/10.2.0/db_1/bin/sqlplus/as sysdba
Oracle pts/10 172.16.1.180 25Jul10 37 days 0.00 s 0.00 s screen-RS hehehehe
Oracle pts/11-25Jul10 37 days 0.03 s 0.02 s ssh 172.16.1.188
Root pts/12 192.168.41.42 0.00 s 0.04 s 0.04 s-bash
Oracle pts/16 172.16.1.180 25Jul10 37 days 0.02 s 0.02 s ssh 172.16.1.188
# Pkill-kill-t pts/8, pts/10, pts/11
# W
11:53:14 up 61 days, 2 users, load average: 0.46, 0.49, 0.46
User tty from login @ IDLE JCPU PCPU WHAT
Root pts/12 192.168.41.42 0.00 s 0.05 s 0.05 s-bash
Oracle pts/16 172.16.1.180 25Jul10 37 days 0.02 s 0.02 s ssh 172.16.1.188
# Pkill-kill-t pts/16
# W
11:53:23 up 61 days, 1 user, load average: 0.39, 0.47, 0.46
User tty from login @ IDLE JCPU PCPU WHAT
Root pts/12 192.168.41.42 0.00 s 0.05 s 0.05 s-bash
-- End --