How the Linux system administrator kicks the user

Source: Internet
Author: User
Tags what parameter pkill

Two methods:
1. Using the Pkill command

1.1 Viewing the currently connected user through who or W
For example:
W

USER TTY from [email protected] IDLE jcpu PCPU
Jjony pts/0 xxx.xxx.xxx.xxx 00:10 0.00s 0.03s 0.01s W
Root pts/1 xxx.xxx.xxx.xxx 00:20 1:25 0.34s 0.34s-bash

Over here:
What parameter reflects the program that the user is running. If the user is executing a program, the name of the program is displayed here, and if you are performing a generic text-mode command, the user environment name is displayed here. The PCPU reflects
CPU time spent executing the program. This time is the time spent executing the program in the What field.
Users login to the Linux operating system in different forms, the terminal code is different. The TTY1-TTY6 represents the Virtual Console from 1 to 6th on the local machine, respectively. PTS indicates that the user is logged on remotely. If the number is: 0 indicates that the user
Xwindow Login System.

1.2 Kick off the user with the Pkill command
For example:
Pkill-kill-t pts/0 can force the jjony to kick out
After locating the terminal code for a user, the administrator needs to use the PS command to find the lowest value of the program identifier PID number in the program that the terminal is executing. Because the PID number is the smallest value corresponding to the application, that is the user login system
The first program that is executed when a Typically this is the user's working environment shell.

2. Use the KILL command

2.1 also use the WHO or W command to view the user's TTY
2.2 Using PS aus | grep pts/0 Viewing user processes
2.3 Use kill plus PID or use kill-9 plus PID to kick the user
Three Ways to Kill:
The KILL command plus the PID number of the shell program to be removed

When the shell environment cannot be closed by kill plus PID process number, it can be closed by Kill-15. This forces the shell process to be removed. This is the same as the restart command under Windows System. In the event of
When it comes to operating system problems, he is a bit tougher than the system logoff. But his destructive effect is also relatively large.

Use the Kill-9 command to remove the shell process. This approach is mandatory, more violent than the above two ways

Original:

Http://www.laxjyj.com/view-htm-tid-164120-cid-49.html

Related Article

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.