在 CentOS/RHEL 6 中更改密码时出错 “passwd: Module is unknown”
on  it road.com

解决方案

/etc/pam.d/system-auth 文件中有一个未知的 PAM 模块 pam_pwquality.so。
pam_pwquality.so 模块应该用于 CentOS/RHEL 7 而不是 CentOS/RHEL 6.

# cat /etc/pam.d/system-auth
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required pam_env.so
auth sufficient pam_unix.so nullok try_first_pass
auth requisite pam_succeed_if.so uid >= 500 quiet
auth required pam_deny.so
account required pam_unix.so
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 500 quiet
account required pam_permit.so
password requisite pam_pwquality.so try_first_pass local_users_only retry=3 minlength=8 lcredit=0 ucredit=-1 dcredit=-1 ocredit=-1 authtok_type=
password requisite pam_cracklib.so ucredit=-1 minclass=3 ocredit=-1 enforce_for_root lcredit=-1 dcredit=-1 minlen=6
password requisite pam_pwhistory.so enforce_for_root remember=12
password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password required pam_deny.so

pam_pwquality.so 用于检查密码的强度,替换 CentOS/RHEL 7 中的 pam_cracklib.so。
在 CentOS/RHEL 6 中将这个 pam_pwquality.so 从配置文件中删除。

# grep pam_pwquality.so /etc/pam.d/system-auth
#

现在尝试再次更改密码。

# passwd oracle
Changing password for user oracle.
New password:

问题

在 CentOS/RHEL 6 中, 使用 passwd 命令更改密码时,出现以下错误:

"passwd: Module is unknown"
日期:2020-09-17 00:14:03 来源:oir作者:oir