《Linux系統下root用戶執行passwd修改密碼時報錯Authentication token manipulation error》要點:
本文介紹了Linux系統下root用戶執行passwd修改密碼時報錯Authentication token manipulation error,希望對您有用。如果有疑問,可以聯系我們。
今天準備修改Linux系統的root用戶密碼時,執行passwd root,出現了以下情況,修改密碼失敗:
# passwd root
Changing password for user root.
New password:
Retype new password:
passwd: Authentication token manipulation error
到網上搜了下,有的說是因為inodes用完,也就是根分區滿了引起的,但執行df -i并非找個原因:
# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda2 6406144 58534 6347610 1% /
tmpfs 8242797 2 8242795 1% /dev/shm
繼續找答案,按照網上的案例檢查用戶密碼相關的系統文件/etc/passwd和/etc/shadow,發現這兩個文件權限有i選項,查詢結果如下:
# lsattr /etc/passwd
—-i——–e- /etc/passwd
# lsattr /etc/shadow
—-i——–e- /etc/shadow
備注:在Linux系統里,文件有i選項則表示不得對其做任何的修改,這也就導致了修改密碼失敗.
要解決該問題,則需要執行chattr -i命令,將以上兩個文件i權限撤銷掉
# chattr -i /etc/passwd
# chattr -i /etc/shadow
# lsattr /etc/passwd
————-e- /etc/passwd
# lsattr /etc/shadow
————-e- /etc/shadow
然后再執行passwd修改密碼,
# passwd
Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
修改完密碼后,為了安全起見,可以執行chattr +i為用戶密碼系統文件增加i權限
# chattr +i /etc/passwd
# chattr +i /etc/shadow
# lsattr /etc/passwd
—-i——–e- /etc/passwd
# lsattr /etc/shadow
—-i——–e- /etc/shadow
轉載請注明本頁網址:
http://www.snjht.com/jiaocheng/3754.html