How to forcefully kick out a logged-in user in centos system

王林
Release: 2020-03-23 17:04:48
Original
2846 people have browsed it

How to forcefully kick out a logged-in user in centos system

In the system, we can use w or who to view the user:

[root@linuxidc ~]# who
root pts/0 2019-04-17 20:45 (58.63.138.162)
root pts/1 2019-05-5 22:24 (118.186.197.221)
 
[root@linuxidc ~]# w
22:33:29 up 4 days, 8:05, 2 users, load average: 1.58, 1.36, 1.47
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 58.63.138.162 20:45 0.00s 0.03s 0.00s w
root pts/1 118.186.197.221 22:24 4:40 0.02s 0.02s -bash
Copy after login

See which user is logged in:

(recommended tutorial : centos usage tutorial)

[root@linuxidc ~]# who am i
root pts/0 2019-04-17 20:45 (58.63.138.162)
Copy after login

Next use pkill to kick out user pts/1:

[root@linuxidc ~]# pkill -kill -t pts/1
Copy after login

Then use w or who to view:

[root@linuxidc ~]# w
22:40:43 up 4 days, 8:12, 1 user, load average: 1.58, 1.36, 1.40
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 58.63.138.162 20:45 0.00s 0.03s 0.00s w
Copy after login

There are no more pts/1, you're done.

Recommended related video tutorials: linux video tutorial

The above is the detailed content of How to forcefully kick out a logged-in user in centos system. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template