linux 不讓改密碼, 提示:passwd: Authentication token manipulation error

perfychi發表於2013-05-03
常見問題
(1)

問題:/etc/passwd, /etc/shadow檔案被鎖住,不允許修改。

   lsattr /etc/passwd
----i-------- /etc/passwd
  lsattr /etc/shadow
----i-------- /etc/shadow

[root@shanxi Desktop]# passwd tom
Changing password for user tom.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: Authentication token manipulation error

解決方法:
[root@shanxi Desktop]# chattr -i /etc/shadow
[root@shanxi Desktop]# chattr -i /etc/passwd
[root@shanxi Desktop]# lsattr /etc/passwd
------------- /etc/passwd
[root@shanxi Desktop]# lsattr /etc/shadow
------------- /etc/shadow
 

(2)/etc/pam.d/認證的地方出問題了

[root@yitai02 ~]# passwd tom
Changing password for user tom .
passwd: Authentication token manipulation error
You have new mail in /var/spool/mail/root

看了一下是有一行被人註解掉了:
[root@yitai02 ~]# cat /etc/pam.d/passwd
#%PAM-1.0
auth       required     pam_stack.so service=system-auth
account    required     pam_stack.so service=system-auth
#password   required    pam_stack.so service=system-auth

解決方法:

反註解
[root@yitai02 ~]# cat /etc/pam.d/passwd
#%PAM-1.0
auth       required     pam_stack.so service=system-auth
account    required     pam_stack.so service=system-auth
password   required    pam_stack.so service=system-auth



另外也可以能是/etc/pam.d/system-auth 檔案內容被人清空了。這種情況也不行。
可以都補上,如下:

[root@yitai02 ~]# cat /etc/pam.d/system-auth
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth        required      /lib/security/$ISA/pam_env.so
auth        sufficient    /lib/security/$ISA/pam_unix.so likeauth nullok
auth        required      /lib/security/$ISA/pam_deny.so

account     required      /lib/security/$ISA/pam_unix.so
account     sufficient    /lib/security/$ISA/pam_succeed_if.so uid < 100 quiet
account     required      /lib/security/$ISA/pam_permit.so

password    requisite     /lib/security/$ISA/pam_cracklib.so retry=3
password    sufficient    /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow
password    required      /lib/security/$ISA/pam_deny.so

session     required      /lib/security/$ISA/pam_limits.so
session     required      /lib/security/$ISA/pam_unix.so

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27042095/viewspace-759711/,如需轉載,請註明出處,否則將追究法律責任。

相關文章