5.3. 更新受管服务帐户的密码

管理服务帐户(MSA)具有一个复杂的密码,由 Active Directory(AD)自动维护。默认情况下,如果 System Services Security Daemon(SSSD)会在 Kerberos keytab 中自动更新 MSA 密码(如果它早于 30 天),它会使其使用 AD 中的密码保持最新状态。此流程解释了如何手动更新您的 MSA 密码。

先决条件

  • 您之前已在 production.example.com AD 域中为主机创建了 MSA。
  • (可选) 您安装了 krb5-workstation 软件包,其中包含 klist 诊断实用程序。

流程

  1. (可选) 在 Kerberos keytab 中显示 MSA 的当前密钥版本号(KVNO)。当前 KVNO 为 2。

    [root@client ~]# klist -k /etc/krb5.keytab.production.example.com
    Keytab name: FILE:/etc/krb5.keytab.production.example.com
    KVNO Principal
    ---- ------------------------------------------------------------
       2 CLIENT!S3A$@PRODUCTION.EXAMPLE.COM (aes256-cts-hmac-sha1-96)
       2 CLIENT!S3A$@PRODUCTION.EXAMPLE.COM (aes128-cts-hmac-sha1-96)
  2. 更新 production.example.com AD 域中的 MSA 的密码。

    [root@client ~]# adcli update --domain=production.example.com --host-keytab=/etc/krb5.keytab.production.example.com --computer-password-lifetime=0

验证步骤

  • 验证您已在 Kerberos keytab 中递增了 KVNO:

    [root@client ~]# klist -k /etc/krb5.keytab.production.example.com
    Keytab name: FILE:/etc/krb5.keytab.production.example.com
    KVNO Principal
    ---- ------------------------------------------------------------
       3 CLIENT!S3A$@PRODUCTION.EXAMPLE.COM (aes256-cts-hmac-sha1-96)
       3 CLIENT!S3A$@PRODUCTION.EXAMPLE.COM (aes128-cts-hmac-sha1-96)