03.Linux-CentOS system user to change the user password issues

问题:
[user@localhost ~]$ passwd
Changing password for user user.
Changing password for user.
(current) UNIX password:
passwd: Authentication token manipulation error

Solution:
1, viewing and storing the user password file attributes.
[the root @ localhost] # the lsattr / etc / the passwd
---- -------- I E- / etc / the passwd
[the root @ localhost] # the lsattr / etc / Shadow
---- ---- I ---- e- / etc / shadow
Note: Check with the lsattr command to store user passwords and file attributes, i found options: (i:. shall not be any change on a file or directory) so causes all users can not modify the password because there is no authority allows.

2, with the chattr i revoke the command, and then modify.
[root @ localhost] # the chattr -i / etc / passwd
[root @ localhost] # the chattr -i / etc / Shadow
[root @ localhost] # the lsattr / etc / passwd / etc / Shadow
--------- E- ---- / etc / passwd
------------- E- / etc / Shadow

3, change the user password.
[The User @ localhost ~] $ passwd

4, for safety reasons, it is best after modifying the password, and then store the file in the user and password protected.
[the root @ localhost] # the chattr + I / etc / the passwd
[the root @ localhost] # the chattr + I / etc / Shadow
[the root @ localhost] # the lsattr / etc / the passwd / etc / Shadow
---- ---- I E- ----- / etc / passwd
---- --------- E- i / etc / Shadow

Guess you like

Origin www.cnblogs.com/LuckyHaTech/p/11987277.html