How to View logged-on users and force them out in CentOS

Source: Internet
Author: User
In CentOS, check that a user has been logged on and kicked out. Linux is a multi-user system. once connected to the network, it can provide services for multiple login users at the same time. The system administrator can understand all the users in the system and what operations the users are performing at any time. View the user's operating system administrator...
In CentOS, check that a user has been logged on and kicked out. Linux is a multi-user system. once connected to the network, it can provide services for multiple login users at the same time.
The system administrator can understand all the users in the system and what operations the users are performing at any time. View the user's OS administrator to know the user's behavior at a certain time point, just enter the command W (w in lower case of CentOS), and enter the following command in the SHELL terminal: you can see that the command W is executed and the result is displayed. Command Information meaning www.2cto.com the above information is shown as follows: the first line shows the summary information of the system, the fields indicate the current system time, system running time, total number of users logged on to the system, and average system load. For the preceding data display, 15:59:27 indicates the execution time of W. Up indicates the system running time. 4 USERS indicates the total number of USERS logged on to the current system. Together with the subsequent numbers, the load average indicates the system LOAD in the past 1, 5, and 10 minutes. The smaller the value, the lighter the system LOAD. A table is formed from the second row. There are 8 columns that show what each user is doing and the system information occupied by the user. USER: displays the login USER account name. The user logs in again, and the account will appear again. TTY: the terminal used for user login. FROM: displays where the user logs on to the system. LOGIN @: indicates the time when LOGIN is logged on to the system. IDLE: the user's free time, from the user's last task after the end of the meeting notes. JCPU: indicates the CPU time consumed by all process tasks related to the terminal within the touch period. PCPU: the CPU time consumed by tasks in WHAT domains after execution. WHAT: Indicates the current task. Www.2cto.com: View a user. when many users log on to the system, you can add a user name after W to view the user's execution status. By default, the system displays all the above information. if you only care about one aspect, you can only use the relevant options. View login users
Similarly, if the system administrator wants to know the users logging on to the system at a specific time, he can use the who command provided by the system. this command can view the users currently logged on to the system and other information: the preceding information is very similar to the W command. If you want to make the list more detailed, you can add the option-HIT and so on to get whether the user is willing to accept other user information (-T) and display the idle time (-I) and the title bar (-H ). If a user is willing to accept the information, a "+" is displayed in the MESG column. you can also use the MESG command to send the information to the user. View the logon user history. if you want to know the historical logon behavior of a user in the system, you can also view the user's previous logon to the system. You can use the LAST command to query the information of users that have logged on to www.2cto.com. when you use the LAST command, there will be a lot of files listed, which cannot be clearly seen. In this case, you can use the management method described earlier to view the content, such as/LAST/LESS. To view the login status of a user, you can add the user name after the LAST command. The system only displays the user's login status. Execute the last command to display the content of the wtmp file in the/var/log/directory. Wtmp files are stored in binary format. if you use a text editor to view them directly, a bunch of garbled characters are displayed. How to KILL a logged-on user in CentOS # pkill-KILL-t pts/0 (pts/0 is the user terminal number displayed in w command) by wyqjx
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.