In terms of accounts, UID/GID may be closely related to permissions. At the same time, you should pay close attention to these two points during manual Account creation and understand what you are doing. The installation and creation of pure numbers are generally used to provide free FTP or other services. You can use the useradd command in F10, however, the same account cannot be created in RH9. Sometimes, when useradd cannot be used to create the account, we can manually create the account, here are several important commands: pwck, grpck, pwconv, pwunconv, chpasswd, kgconv, grpunconv are several important commands when you create an account manually. They can help us check whether the created account is successful.
Pwck: this command is used to check the information in the/etc/passwd account setting file and whether the home directory exists, you can also check whether/etc/passwd is consistent with/etc/shadow. If there is any difference, the system will prompt you whether to synchronize.
Grpck: used to check the/etc/group and/etc/gshadow files, which is similar to pwck.
Pwconv: The main purpose of this command is to move the account and password in/etc/passwd to/etc/shadow. This command is very important in earlier linux systems, in the early days, the account and password were stored in the/etc/passwd file. To ensure security, you can move the account and password to the/etc/shadow file. Then, you can use this command. Now you can use this command to compare the/etc/passwd and/etc/shadow files. If no account information about/etc/passwd is found in/etc/shadow, then you will find/etc/login. defs file to set account information.
>.
Login. defs: this file is one of the several files that need to be searched when useradd is used to create an account. This file contains the parameter information related to UID/GID. For example, the minimum and maximum values of UID. Of course, exclude the-r option. This option is used to create a system account.
Pwunconv: a very dangerous command. If there is a backup, you can use this command to test if there is no/etc/shadow file and/etc/passwd file backup, the consequences are unimaginable. This command is used to import all the passwords of the corresponding/etc/passwd file accounts in the/etc/shadow file to the second line of/etc/passwd, and the/etc/shadow file will be deleted...
Grpunconv: similar to pwunconv.
Chpasswd: according to the information in the manual, we can see that this command is used to create accounts in batches. You can also use newusers, which is a command for the same purpose as chpasswd. You can also use chpasswd to update the account password.
Create a Special Account:
* Edit/etc/group to create a user group. You can use vi
* Synchronize/etc/group to/etc/gshadow, and use the maid command
* Edit the/etc/passwd file to create an account and edit the account and corresponding information. You can use vi
* Synchronize/etc/passwd to/etc/shadow and run the pwconv command
* You can use the passwd command to update the account password. You can also use the chpasswd or newusers command to create an account and password.
* Create the user's home directory cp-A/etc/skel/home/AccountName
Skel directory: This directory stores the default directory information. This directory is also referenced when useradd is used to create an account.
* Change the home Directory attribute chown-R AccountName: Group/home/AccountName
This article is from the "go there" blog