Kicking out disobedient users in Linux

Source: Internet
Author: User
Article Title: Force disobedient users out of the system in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

As we all know, Linux is a multi-user operating system. For example, multiple users can log on to the Linux system at the same time, and even the same user can log on multiple times at the same time. However, sometimes the system administrator may find some disobedient users. For example, these users may have some unauthorized access or occupy too many resources. In this case, the system administrator needs to remove them from the system. What should we do?

For example, I have a Linux server and now two users are connected to the operating system. (I use different account names on the same computer to log on, so the latter displays the same IP address .) There are indications that Oracle users are currently conducting illegal activities. For the sake of security, I want to immediately kick this user out of the Linux server and interrupt the connection between the user and the Linux server. I will introduce how to achieve this goal step by step.

  Step 1: Use the who command to find the terminal code for user logon.

If the system administrator wants to kick a user out of the operating system, he must first understand how the user waits for the user to log on to the operating system. The terminal code of a user logging on to the Linux operating system in different forms is different. The TTY1-TTY6 represents the virtual consoles from 1 to 6 on the machine. PTS indicates that the user logs in remotely. If the number is: 0, the user logs on to the system from XWindow. If the system administrator needs to know how a user logs on to the Linux operating system, he or she can use the who command to query the logs. In the preceding example, the second field is the method used by the user to log on to the operating system. PTS indicates that the oracle user is logged on remotely. For example, you may log on to the Linux operating system through the ssh protocol. Mastering this information is the key to kicking users out of the operating system.

In addition, if the system currently has a large number of login users, the system administrator will be dazzled by executing the who command to list all the data. If the system administrator knows the user name to be kicked out of the operating system, he or she can use the who user name to display the information of a specific user. If the system administrator does not know the specific name of the user, but only vaguely remembers that the user may start with "o", you can also use wildcards to perform fuzzy queries. In addition, if you only need to query the user's Terminal code information, you can add specific parameters after the who command.

Sometimes the Administrator may also need to use a sibling w command of the who. This command provides more detailed information than the who command. In particular, there is a pcpu and what parameter that can be used to provide the Administrator with some reference for kicking the user out of the operating system. What parameter indicates the program that the user is running. If the user is executing a program, the name of the program is displayed here; if the user is executing a general text mode command, the name of the user environment is displayed here. Pcpu reflects the CPU execution time. This time is the time consumed by executing the program in What field. Therefore, this information can help Administrators determine whether the user has stored illegal behaviors or is executing programs that consume operating system resources. At the same time, you can also analyze the possible losses caused to users forced out of the operating system from the results. If the system administrator is eager to kick the user out, you can directly use the who command to find the terminal code of the user. Both commands can query the user's Terminal code.

[1] [2] [3] Next page

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.