linux users forced offline

Linux system is a multi-user multi-tasking system, thus allowing multiple users to log into the system, sometimes, we need to force some users offline.

 

Premise : You must be root privileges
operations :
(1) Use who to see which users are currently logged into the server, see below

[root@vm18 ~]# who
root     pts/0        2015-03-27 10:23 (192.168.9.188)

From the foregoing it can be seen that the root user is using the ip address 192.168.9.188 to log on to the system linux

 

(2) root to see what time logged in the system 

[root@vm18 ~]# last root
root     pts/0        192.168.9.188    Fri Mar 27 10:23   still logged in    

 

(3) using pkill -kill -t pts / 0 command kick first user, i.e. forced offline.

[root@vm18 ~]# pkill -kill -t pts/0

Command interpreter: pts / 1 corresponds to the user's TTY.

Guess you like

Origin www.cnblogs.com/qianjinyan/p/11278810.html