更改密码时系统多次提示输入密码?

环境

  • RHEL Linux 6
  • RHEL Linux 7
  • PAM

问题

  • 在更改系统上任何用户的密码时,要求输入密码三次(或多次)。
[root@server ~]# passwd  testuser
Changing password for user testuser.
New password: 
Retype new password: 
Retype new password:         <------ 额外的密码提示
passwd: all authentication tokens updated successfully.
[root@server~]#

解析

  • 从/etc/pam.d/passwd和/或/etc/pam.d/system-auth文件中删除密码策略/复杂度模块的额外条目(多行)。

  • 对于RHEL 7,/etc/pam.d/system-auth文件中的默认密码部分应如下所示:

password    requisite     pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type=
password    sufficient    pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password    sufficient    pam_sss.so use_authtok
password    required      pam_deny.so
  • 然而/etc/pam.d/passwd看起来应该像这样:
auth       include  system-auth
account    include  system-auth
password   substack system-auth
-password   optional    pam_gnome_keyring.so use_authtok
password   substack postlogin
  • 如果是RHEL 6,文件中应该是pam_cracklib.so而不是pam_pwquality.so。

解决

现有环境因基准加固的修改了system-auth导致该问题,
/etc/pam.d/system-auth 文件中的 password requisite pam_cracklib.so try_first_pass retry=3 type= 注释保存后解决。(无需重启)

参考:
1.RHEL Why does system prompt to enter password multiple times while changing the password?

posted @ 2020-11-19 17:41  吴诺克  阅读(1818)  评论(0编辑  收藏  举报
Copyright © 豆子林克 DOUZI.LINK  版权所有. 除特别申明外,本站原创内容版权遵循 CC-BY-NC-SA 协议规定