As shown in the figure below, the
reason for the error will be reported when changing the password :
usually the /etc/passwd file or the /etc/shadow file is locked if the password cannot be changed
Solution:
Check whether the /etc/passwd file and the /etc/shadow file are locked, see the following figure:
①Check the /etc/passwd file
/etc/passwd file is normal
②Check the /etc/shadow file.
You can see that the /etc/shadow file is indeed locked. A permission means "files can only be appended after locking".
If it is i, it means "locked files (cannot be modified, deleted, etc.)"
③Unlock the /etc/shadow file
④Try to modify the password again. The
modification is successful! ! !