CentOS6.2解决passwd: Authentication token manipulation error报错(转载)

passwd: Authentication token manipulation error这种错误可能有多种原因,就我了解的可能有/etc/passwd等文件+i权限
今天在给学员上课的时候发现提示passwd: Authentication token manipulation error错误,我来简单描述今天的问题
[root@host4 Scripts]# cat pass.txt 
123456
[root@host4 Scripts]# useradd user01
[root@host4 Scripts]# passwd --stdin user01 < pass.txt                     
Changing password for user user01.
passwd: Authentication token manipulation error
但是我这样却是可以的
[root@host4 Scripts]# echo "123456" | passwd --stdin user01
Changing password for user user01.
passwd: all authentication tokens updated successfully.
说明/etc/shadow应该权限没问题
[root@host4 Scripts]# tail /var/log/messages
[root@host4 Scripts]# tail /var/log/audit/audit.log 
type=USER_CHAUTHTOK msg=audit(1333893689.927:16840): user pid=1753 uid=0 auid=0 ses=2 subj=unconfined_u:unconfined_r:passwd_t:s0-s0:c0.c1023 msg='op=change password id=512 exe="/usr/bin/passwd" hostname=? addr=? terminal=pts/0 res=failed'
[root@host4 Scripts]# setenforce 0
[root@host4 Scripts]# passwd --stdin user01 < pass.txt  
Changing password for user user01.
passwd: all authentication tokens updated successfully.
原来是selinux在捣鬼~!





原文地址:https://www.cnblogs.com/djinmusic/p/2801357.html