更改密碼時系統多次提示輸入密碼?


環境

  • 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?


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM