[zz]linux修改密码出现Authentication token manipulation error的解决办法
年底需要修改一次密码,修改的时候遇到了问题,无法修改密码,经过baidu 、google,找到了可能引起的原因,成功修改密码。
以下内容来自于网络。
Authentication token manipulation error
发生该错误原因是:
1、分区没有空间导致。
2、/etc/passwd 和/etc/shadow不同步
但是这次上面两条却行不通,通过df查看根分区还有40%剩余。
1、尝试修改密码,出现错误
# passwd
Changing password for user root.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
passwd: Authentication token manipulation error
Changing password for user root.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
passwd: Authentication token manipulation error
2、同步/etc/passwd 和/etc/shadow出错
#pwconv
pwconv: can't lock passwd file
#pwconv
pwconv: can't lock passwd file
3、看权限没有异常,也没有进程锁定该文件
# ll /etc/passwd
-rwxr--r-- 1 root root 2752 Dec 31 17:29 /etc/passwd
# fuser -u /etc/passwd
# lsof |grep passwd
# ll /etc/passwd
-rwxr--r-- 1 root root 2752 Dec 31 17:29 /etc/passwd
# fuser -u /etc/passwd
# lsof |grep passwd
4、cp lock文件出错,提示空间不足
# cp /tmp/.pwd.lock /etc/
cp: cannot create regular file `/etc/.pwd.lock': No space left on device
cp: cannot create regular file `/etc/.pwd.lock': No space left on device
5、上面的错误惊醒了我,查看确实是inode满了,删除无用的文件
#df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda5 2562240 2562240 0 100% /
/dev/sda1 50200 47 50153 1% /boot
/dev/sda2 51300000 12 51299988 1% /data/cache1
/dev/sdb1 51300000 7080311 44219689 14% /data/cache2
/dev/sdb2 9863168 11 9863157 1% /data/proclog
none 215907 1 215906 1% /dev/shm
/dev/sda3 3842720 305795 3536925 8% /usr
/dev/sda7 3162112 7893 3154219 1% /var
6、再次修改密码仍然出错,于是尝试修改/etc/passwd也出现错误
#df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda5 2562240 2562240 0 100% /
/dev/sda1 50200 47 50153 1% /boot
/dev/sda2 51300000 12 51299988 1% /data/cache1
/dev/sdb1 51300000 7080311 44219689 14% /data/cache2
/dev/sdb2 9863168 11 9863157 1% /data/proclog
none 215907 1 215906 1% /dev/shm
/dev/sda3 3842720 305795 3536925 8% /usr
/dev/sda7 3162112 7893 3154219 1% /var
6、再次修改密码仍然出错,于是尝试修改/etc/passwd也出现错误
# chmod 777 /etc/passwd
chmod: changing permissions of `/etc/passwd': Operation not permitted
7、执行chattr
#chattr -i /etc/passwd
# lsattr -v /etc/passwd
2095582053 ------------- /etc/passwd
chmod: changing permissions of `/etc/passwd': Operation not permitted
7、执行chattr
#chattr -i /etc/passwd
# lsattr -v /etc/passwd
2095582053 ------------- /etc/passwd
# chattr -i /etc/shadow
8、同步文件
pwconv
pwconv
9、成功修改密码
passwd
Changing password for user root.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.