Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to force a logged-in user to be kicked out using centos

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How do I force a logged-in user to be kicked out using centos? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

Linux is a multi-user operating system. Users can link to LINUX servers in different places. In the system, we can use w or who to view users.

[root@7273] # whoroot pts/0 2018-05-5 20:45 (58.63.138.162) root pts/1 2018-05-5 22:24 (118.186.197.221) [root@7273] # w22 up 3329 up 4 days, 8:05, 2 users, load average: 1.58,1.36 1.47USER TTY FROM LOGIN@ IDLE JCPU PCPU WHATroot pts/0 58.63.138.162 20:45 0.00s 0.03s 0.00s wroot pts/1 118.186.197.221 22:24 4:40 0.02s-bash

Let's see if you can log in by yourself.

[root@7273] # who am i root pts/0 2013-05-17 20:45 (58.63.138.162) pkill,pts/1

Then use pkill to kick out the user.

[root@7273] # pkill-kill-t pts/1

Then use w or who

[root@7273] # w22 user 40 days 43 up 4 days, 8:12, 1 user, load average: 1.58,1.36, 1.40USER TTY FROM LOGIN@ IDLE JCPU PCPU WHATroot pts/0 58.63.138.162 20:45 0.00s 0.03s 0.00s w

The great task has been completed

Here are the picture and text steps

Centos forcibly kicks out a logged in user

First, let's use w to see what is logged in, for example, the result is as follows

Here is an example of the login that needs to be kicked out of root

Because his tty is pts/1, type pkill-kill-t pts/1 and make sure

When it was finished, we looked again and found that it was gone.

This is the answer to the question about how to force a logged-in user to be kicked out by using centos. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report