Ubuntu修改用户密码时,出现: passwd: Authentication token manipulation error

来源:互联网 发布:iphone6s怎么备份数据 编辑:程序博客网 时间:2024/05/26 02:20

修改用户密码时,出现:passwd: Authentication token manipulation error

1.修改密码时提示错误

root@iZ28m0c0sk6Z:/# passwd piaocoderEnter new UNIX password: Retype new UNIX password: passwd: Authentication token manipulation errorpasswd: password unchanged

2,修改权限时提示错误
root@iZ28m0c0sk6Z:/# chmod 755 /etc/passwdchmod: changing permissions of `/etc/passwd’: Operation not permitted

3,同步/etc/passwd 和/etc/shadow出错
#pwconvpwconv: can’t lock passwd file

4,操做方法。
检查:

# fuser -u /etc/passwd#查看是否有写入权限# lsof |grep passwd#查看是否有写入权限# ll /etc/.pwd.lock        #查看是否有此文件# df -i        #查看是否空间被占满# lsattr /etc/shawr        #查看是否被写保护

lsattr /etc/passwd—i———- //被标记了i属性

chattr -i /etc/passwdchmod 755 /etc/passwd

lsattr /etc/shadow—-i——– //被标记了i属性

chattr -i /etc/shadowchmod 755 /etc/shadow

#pwconv 同步/etc/passwd 和/etc/shadowpawsswd piaocoder 不会出错了。修改密码后

5,加回保护
#chattr命令只能管理员使用,重新保护passwd文件chattr +i /etc/passwdchattr +i /etc/shadow

还有一种可能就是有的系统是限制了5天内不能修改密码,也会出现这样的错误。


1 0