As a Linux administrator, you need to manage the system account reasonably, including group creation, password setting, and authority management. Today, Xiaobian wants to introduce you to the management of CentOS accounts, and friends who don’t know how to manage them. Can come and learn.
Each file in Linux is divided into three types of permissions: the permissions of the account itself, the permissions of the group in which the account is located, and other permissions. Accounts and groups are many-to-many relationships, that is, one account can belong to multiple groups, and one group can contain multiple accounts. However, for each logged in account, there can only be one currently active group (initial group).
The account management related configuration files are as follows: account information file is /etc/passwd, account password file is /etc/shadow, group information file is /etc/group, group password file is /etc/gshadow .
1, /etc /passwd file to see how
as shown above, /etc /passwd file for each account a behavior, as colon of each field divided by mean number They are as follows:
[1] Account name. Renamed using the command usermod -l
[2] password, this field is enabled. The account password is configured in the /etc/shadow file
[3] UID, the unique identifier of the account. The commands that affect the value of this field include: useradd -u, usermod -u
[4] GID, the unique identifier of the initial group, associated with the third field of the /etc/group file. This group is the default valid group for the account (the active group can be switched using the newgrp command). The commands that affect the value of this field are: useradd -g, usermod -g
[5] Description. The commands that affect the value of this field include: useradd -c, usermod -c
[6] The absolute path to the home directory. The commands that affect the value of this field include: useradd -d, usermod -d
[7] shell, the shell that is enabled by default on the account. When it is /sbin/nologin, the account cannot be logged in. The shell that the account can use can be queried with the command chsh -l (the result of the query is the contents of the /etc/shells file). Effect of the command field value comprises: useradd -s, usermod -s
2, /etc /shadow file to see how each line
as shown above, the file /etc /shadow of Corresponding to the password information of an account, the meaning of each field with a colon as a segmentation is as follows:
[1] Account name, associated with the first field of the /etc/passwd file
[2] Password, encrypted ciphertext, the encryption algorithm is specified by ENCRYPT_METHOD in the /etc/login.defs file, here SHA512. Commands that affect the value of this field include: usermod -L (pre-!! freeze), usermod -U (defrox), passwd -l (freeze), passwd -u (defrox),
[3] Date, the above image shows a number indicating the number of days since 1970-01-01. The commands that affect the value of this field include: chage -d
[4] How many days after the password is created to be modified again, 0 means no such restriction. The commands that affect the value of this field include: passwd -n, chage -m
[5] How many days after the password is created expires, 99999 days is equal to 99999/365 years, and hundreds of years means the password will not expire. The commands that affect the value of this field include: passwd -x, chage -M
[6] How many days before the password expires, the warning message is sent to the user. The commands that affect the value of this field include: passwd -w, chage -W
[7] How many days can the password be extended after the password expires? During this time period, the user can also log in and change the password. After this time. Segment users will not be able to log in. Commands that affect the value of this field include: useradd -f, usermod -f, passwd -i, chage -I
[8] Expiration date, a number indicating that it has been experienced since 1970-01-01 The number of days. After this day, the user's password will be invalid, and you can't log in any time, whether it is expired or not. The commands that affect the value of this field include: useradd -e, usermod -e, chage -E
[9] Reserved
Previous123Next page Total 3 pages
As a Linux administrator, you need to manage the system account reasonably, includi
less than 1024 in Linux In Linux systems, in general, ports smaller than 1024 are not open to ordin
Because the files deleted by the rm command are not put into the garbage bin, they cannot be restore
Those who have used Ubuntu system know that there is a software center in Ubuntu sy
How Ubuntu System Uses Script to Upgrade Kernel
Ubuntu system configuration Ruby On Rails development environment method
Linux off screen splash screen method
What should I do if there is garbled code on the Firefox browser page under Linux?
What should I do if the Java process under Linux system disappears without cause?
What commands are used for Linux system monitoring?
How to handle Too many open files under Linux?
How to verify SHA1 and MD5 in Linux system?
How to use and manage swap space in Linux
Techniques for setting up multiple network cards as virtual network cards under Linux
Can I install IE9 under Windows XP system environment?
Win7 boot desktop prompt keyboand not found pyess how to do?
How does the Win8 system turn off the UEFI boot mode?
Quick self-help emergency Windows recovery disk (3)
The latest version of Win10 Mobile 10536 has entered the internal slow channel
How to display win10 hidden files?
Microsoft updated the built-in applications "Windows Camera" and "Recorder"
Let your windows7 system more perfect setting 12 kinds of tips (3)
Teach you how to correctly distinguish between 32-bit and 64-bit operating systems