Article Title: galloping in the Linux World-Linux System Management 8. 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.
2. User Account Management
The management of user accounts includes how to ensure the security of each user account in the system, how to manage these accounts, and how to handle accounts that threaten system security.
It is necessary to ensure that the system has a secure/etc/passwd file. When maintaining this file, pay attention to the following issues:
(1) Avoid directly modifying the/etc/passwd file.
(2) Use complicated user account names whenever possible.
(3) try to limit the number of people with UID 0 in the passwd file to one or two people. If the UID other than the Administrator is 0, the system is cracked. Run the following command to display users whose ID is 0 in the passwd file:
# Grep '[^:] * [^ *] *: 0 *'/etc/passwd
(4) ensure that no user account with the same password is in the passwd file. The following command is used to query whether a user with ID = 110 exists in the file:
# Grep 110/etc/passwd
(5) Ensure that the password field of each user in the passwd file is not empty. You can use the following command:
# Grep '[^:] * [^:]: *'/etc/passwd
(6) Pay attention to the Shell fields used by special users in the system to ensure that they use special programs rather than the Shell of general users.
(7) do not use group passwords unless necessary.
(8) It is best for new users to provide rsh (Restricted Shell) for them to use the system in a Restricted environment.
(9) When an account is not used for a long time, you can use the accounting mechanism to find the account and seal it up.
3. Security Issues
File and directory permission management involves important directory security issues, including the following directories:
/Bin,/boot,/dev,/etc, and $ HOME.
The/bin directory stores all executable programs and common Linux commands required by the boot system. This directory can only be modified by the Super User. At the same time, the directory should be set at the beginning of the PATH environment variable. For example:
PATH =/bin:/usr/local/bin:/home/mengqc/bin
If it is set at the end, you can place a trojan named su in your own directory. When a superuser executes the su command, mengqc can obtain the superuser password.
/Boot is used to store some data and files required during Linux Startup. If the directory is damaged, the system cannot start.
The/dev directory contains files with links to hardware devices. Its access permission should be 775 and should be owned by root. Improper permission settings for using device files can affect system security. For example, if/dev/mem is the system memory, you can use the cat command to display the content in the system memory on the terminal.
Files under the/etc directory, such as passwd, group, shadow, inittab, cshrc, and xinitrc, are used when the system works normally. In most cases, files in/etc are preferred targets for hackers.
The $ HOME directory is the main directory of each user, usually in the/home directory. The directory name is generally the same as the user's login name. The main directory of the Super User is under/root.
If you do not set the user's home directory permission correctly, this user may be at risk. For example, if another user can write a user's home directory, you can modify the. bash_profile file in the user's home directory to obtain the same identity as the user.
4. Routine maintenance of system logs
Another complex task for system administrators is to perform routine maintenance of system logs. System Logging provides detailed audit information for system activities, which are used to evaluate and review the operating environment and various operations of the system. In general, logging includes recording the User Logon Time, logon location, and operations. If used properly, log records can provide administrators with information about intrusions or intrusion attempts that endanger security.
These audit information is usually automatically generated by the daemon and is part of the default system settings. It can help administrators find system problems and is very useful for system maintenance. Some logs need to be set by the Administrator to take effect. Most logs are stored in the/var/log directory.
System Performance Optimization
The optimization of system performance mainly includes the following aspects:
◆ Optimizes disk I/O performance;
◆ Organically adjust the file system;
◆ Process execution scheduling;
◆ Manage System daemon tasks.
Use iostat to monitor disk I/O performance iostat to check input and output of each disk, and generate data throughput and transmission request statistics of each disk. The following is an example of using the iostat command:
# Iostat-d 2
This command generates a statistical output on the usage of the system disk at an interval of 2 seconds. Use this tool to obtain the performance of the system disk based on the data throughput when the hard disk is busy. At this point, the system administrator should come to the following conclusion:
(1) Whether the I/O performance of the current disk has affected the performance of the entire system. For example, the CPU often waits for I/O operations and the CPU idle status appears.
(2) whether the user's work has been affected. For example, if the NFS service is used, does the file server often fail to process user requests in a timely manner.
(3) whether the current I/O of the hard disk system is concentrated on one or more disks causes Unbalanced Task requests.
For these problems, the system administrator should take the following measures:
◆ Use RAID technology to improve hard disk I/O performance;
◆ High-performance hard disks are used to solve the I/O bottleneck;
◆ Adopt more advanced and faster hard disk interface technology;
◆ Adjust the file system and schedule the execution process.
Schedule Processes
A process needs to occupy system resources during its operation. If the user executes a process that consumes too much resources, it may cause a bottleneck of system performance. In this case, you need to schedule such a process. One case is to negotiate with the user to delete the process from the system. In this case, the system administrator needs to use the kill command; in another case, you need to adjust the priority or scheduling time of the process, which can be completed through nice and at commands.
To make the system good service, you must manage the system. As a system administrator, the power is the highest and the responsibilities are significant. The above describes the basic knowledge of system management. However, to keep the system in good working state, in addition to in-depth understanding of management knowledge, we also need to continuously accumulate experience in practice.
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