Originally Posted by prayag_pjs
Please elaborate and let us know your exact problem?
For your information:
pwconv is system administration command to convert unshadowed entries in /etc/passwd into shadowed entries in /etc/shadow. Replace the encrypted password in /etc/password with an x. Shadowing passwords keeps them safe from password-cracking programs. pwconv creates additional expiration information for the /etc/shadow file from entries in your /etc/login.defs file. If you add new entries to the /etc/passwd file, you can run pwconv again to transfer the new information to /etc/shadow. Already shadowed entries are ignored. pwunconv restores the encrypted passwords to your /etc/passwd file and removes the /etc/shadow file. Some expiration information is lost in the conversion. See also grpconv and grpunconv.
Is there any way of validating entries in /etc/shadow files using pwconv utility?
for example is there any way of running pwconv utility and making sure that /etc/shadow file is upto date or valid.
Exact statement from book.
Lines in the /etc/shadow file must have a valid format either as checked by the pwconv program, or must meet the following requirements:
* 126.96.36.199 Line Format: Each line must have nine (9) colon-separated fields. There must be no blank lines (including the last line). The nine fields are interpreted as follows:
*Note: The first two fields must not be blank.
* 188.8.131.52 Valid User: Usernames must directly correspond to usernames which exist in /etc/passwd or in an enabled name service (e.g., LDAP, NIS) password map, and must conform to all the same rules as usernames in /etc/passwd.
* 184.108.40.206 Duplicate Usernames: There must be no duplicate usernames. Each line must contain a unique username.
* 220.127.116.11 Passwords: Passwords in /etc/shadow must be in compliance to the published AS Authentication & Password Policy published at URL:
In addition the encrypted password stored in the 2nd (ie: passwd) field of the shadow file must have 13-24 characters as per specified in the LINUX section 5 man page for shadow file format.
* 18.104.22.168 uid=0 Passwords: Passwords for uid=0 accounts must not be the same as those used for other accounts.
* 22.214.171.124 File Permissions: The /etc/shadow file must be owned by root and have permissions of 0400.
* 126.96.36.199 Locked Accounts: All accounts that are locked or do not require the ability to login to the system must conform to section 188.8.131.52 of this document along with having a single exclamation mark "!" as the first character of the 2nd (ie: passwd ) field of the shadow file entry.
I m confused over first line "as checked by the pwconv program" Which option to use for checking ?