使用 realmd 将 linux 台主机加入到 AD 服务器。无法从命令行更改广告用户密码

Joined linux host to AD server using realmd. Unable to change ad user passwords from the command line

对一台 AD 服务器和各种 linux 主机进行相当简单的设置。我们使用以下方法将 linux 台主机附加到我们的域:

realm discover domain.example.com
realm join domain.example.com -U user.adm

我们的 /etc/sssd/sssd.conf 看起来像:

[sssd]
domains = domain.example.com
config_file_version = 2
services = nss, pam

[domain/domain.example.com]
ad_domain = domain.example.com
krb5_realm = DOMAIN.EXAMPLE.COM
realmd_tags = manages-system joined-with-samba
cache_credentials = True
id_provider = ad
krb5_store_password_if_offline = True
default_shell = /bin/bash
ldap_id_mapping = True
use_fully_qualified_names = false
fallback_homedir = /home/%u@%d
access_provider = simple
simple_allow_groups = linuxaccess@domain.example.com

从这里我们可以作为属于 linuxaccess 组的 AD 用户登录。我试图重设密码但得到:

[username.lin@hostname ~] passwd
Current Password:
New password:
Retype new password:
Password change failed. Server message: Access denied
passwd: Authentication token manipulation error

/var/log/secure 显示:

Oct 12 14:39:48 computer passwd: pam_unix(passwd:chauthtok): user "username.lin" does not exist in /etc/passwd
Oct 12 14:40:01 computer passwd: pam_unix(passwd:chauthtok): user "username.lin" does not exist in /etc/passwd
Oct 12 14:40:01 computer passwd: pam_sss(passwd:chauthtok): Password change failed for user username.lin: 20 (Authentication token manipulation error)

关于为什么更改密码似乎不受支持或者可能是什么错误配置的想法?猜中了 pam.d 但不确定。

我尝试重现您的场景,但在尝试更改 AD 用户的密码时我也遇到了同样的错误。

默认组策略有一个“密码最短使用期限”,这将防止您在创建用户/上次密码更改后的 24 小时内更改密码。

解决方案是将 GPO 更改为零日并在域控制器上执行 gpupdate - 或者等待 24 小时。

您的 Active Directory 服务器上的 GPO 安全设置很可能是默认设置或可能由 AD 管理员自定义。

注意:最短密码年龄: 将此值设置为 1 天。 Microsoft 建议不要将此设置为 0,因为它会允许立即更改密码。用户可以在同一天更改密码24次并恢复到旧密码。

参考:https://www.pcwdld.com/domain-password-policy-how-to-configure#wbounce-modal