Forced to kick off the login user under Linux system

Source: Internet
Author: User
Tags pkill

Forced to kick off the login user under Linux system


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
15:49:22 up 18:24, 5 users, Load average:0.00, 0.03, 0.10
USER TTY [email protected] IDLE jcpu PCPU what
Root tty1 2days 0.11s 0.00s xinit/etc/x11/xinit/xinitrc--/usr/bin/x: 0 Vt1-auth/root/.serverauth
Root pts/0 14:05 1:54 0.20s 0.20s Bash
Oracle PTS/1 14:16 40:26 0.19s 0.18s-bash
Root PTS/2 15:09 1:46 0.47s 0.47s-bash
Root PTS/3 15:49 2.00s 0.34s 0.21s W

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

Pkill-kill-t tty1

Pkill-kill-t PTS/1


Explain:

Pkill-kill-t Kick Man Command

TTY kicked user's TTY

The command to kick out the Oracle 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 14:05 1:54 0.20s 0.20s Bash

First, use the command to view the pts/0 's process number, which is the following command:
[Email protected] ~]# Ps-aux |grep pts/0
Root 98041 0.0 0.1 116664 2988 pts/0 ss+ 14:05 0:00 Bash
Root 109210 0.0 0.0 116840 988 PTS/3 r+ 15:58 0:00 grep--color=auto pts/0 kicks off the user's command:
Kill-9 98041


This article is from the "Technical Achievement Dream" blog, please be sure to keep this source http://pizibaidu.blog.51cto.com/1361909/1612428

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.