In Linux, run the pkill command to kick out the online logon user.

Source: Internet
Author: User
Tags pkill

In Linux, run the pkill command to kick out the online logon User:
Linux is a multi-user and multi-task operating system. Users can connect to Linux servers through SSH in different places.WCommand to view the current online login user.
03:05:23 up 19 min, 3 users, load average: 0.00, 0.03, 0.05
User tty from login @ idle jcpu pcpu what
Root pts/0 192.168.0.2 3.67 s 3.43 S/usr/bin/perl
Root pts/1 192.168.0.31 0.00 s 0.20 s 0.02 s w
Root pts/2 192.168.0.23 052 2.00 s 0.08 s 0.08 s-Bash
As you can see, three users have logged on to the server. Next, use the Who am I command to check that it is your logon terminal, and the following is pts/1.
[Root @ centos ~] # Who am I
Root pts/1 (192.168.0.31)
Next, run the pkill command to kick out the target user.
[Root @ centos ~] # Pkill-kill-T pts/2
Run the W command to check whether the PTS/2 terminal user has been kicked out.
[Root @ centos ~] # W
03:07:28 up 21 min, 2 users, load average: 0.00, 0.02, 0.05
User tty from login @ idle jcpu pcpu what
Root pts/0 192.168.0.2 3.68 s 3.44 S/usr/bin/perl
Root pts/1 192.168.0.31 045 0.00 s 0.23 s 0.01 s w view current Login User
Who
Who-u
Who-Q
Who-I
Who-T
Finger
Last view the historical logon list

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.