Forced to kick off the login user under Linux system

Source: Internet
Author: User
Tags pkill

Linux system root users can be forced to kick the other login users, first use the $w command to view the logged in user information, display information as follows:
[Email protected] ~]# W
10:01:23 up 1:23, 3 users, load average:0.71, 0.58, 0.57
USER TTY from [email protected] IDLE jcpu PCPU
Root tty2-09:59 1:53 0.01s 0.01s-bash
Root pts/0:0.0 10:01 0.00s 0.03s 0.00s W
Wangbo pts/2 192.168.0.196 09:42 18:50 0.01s 0.01s-bash
[Email protected] ~]#

Force kick Man Command format: pkill-kill-t TTY

Explain:

Pkill-kill-t Kick Man Command

TTY kicked user's TTY

The command to kick out the Liu user as above is: Pkill-kill-t PTS/1

Only the root user can kick people, at least that's what I'm testing. If there are two people logged in with the root user at the same time, any one of them can kick off the other. Any user can kick off their-_-
How to kick off a user with terminal login, such as:
Root pts/0:0.0 10:01 0.00s 0.03s 0.00s W
First, use the command to view the pts/0 's process number, which is the following command:
[Email protected] ~]# Ps-ef | grep pts/0
Root 15846 15842 0 10:04 pts/0 00:00:00 bash
Root 15876 15846 0 10:06 pts/0 00:00:00 ps-ef
Root 15877 15846 0 10:06 pts/0 00:00:00 grep pts/0
Kick off the user's command:
Kill-9 15846

Forced to kick off the login user under Linux system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.