
私は何年もの間、小規模ネットワークで Kerberos / LDAP 認証を実行しています。Kerberos は LDAP に保持され、別のサイトに複製されます。2 番目のサイトのマシンはレプリカに対して認証し、古いサイトは元のサーバーに対して認証します。最近、新しいユーザー アカウントをいくつか追加しました。
元のサイトではすべてがスムーズに動作します。新しいユーザーは問題なくシステムにログインできます。
レプリカを使用した 2 番目のサイトでkinit user
も問題なく動作します。ただし、login user
パスワードの有効期限が切れているため、すぐに変更する必要があると表示されます。パスワードを変更すると、ユーザーは正常にログインできます。
レプリカ KDC の設定をkadmin.local
すべて確認すると、問題ないように見えます。
kadmin.local: getprinc user
Principal: [email protected]
Expiration date: [never]
Last password change: Di Nov 22 21:06:35 CET 2022
Password expiration date: [never]
Maximum ticket life: 0 days 10:00:00
Maximum renewable life: 7 days 00:00:00
Last modified: Di Nov 22 21:06:35 CET 2022 ([email protected])
Last successful authentication: Di Nov 22 21:19:27 CET 2022
Last failed authentication: So Nov 13 09:05:17 CET 2022
Failed password attempts: 0
Number of keys: 8
[ ... ]
Attributes: REQUIRES_PRE_AUTH
Policy: [none]
したがって、パスワードもプリンシパルも期限切れになりません。そして、kinit
期待どおりに動作します。
root@client:~# kinit user
Password for [email protected]:
root@client:~# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: [email protected]
Valid starting Expires Service principal
22.11.2022 21:25:17 23.11.2022 07:25:17 krbtgt/[email protected]
renew until 23.11.2022 21:25:11
しかし、login
パスワードの有効期限が切れているため変更する必要があると主張しています。
root@ganesha:~# login user
Password:
Sie müssen Ihr Passwort sofort ändern (Passwortablauf).
Current Kerberos password:
Enter new Kerberos password:
Retype new Kerberos password:
Linux client 5.10.0-19-amd64 #1 SMP Debian 5.10.149-2 (2022-10-21) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Letzte Anmeldung: Dienstag, den 22. November 2022, 20:59:02 CET auf pts/5
user@client:~$
このログインに続いて、プリンシパルのLast password change
と がLast modified
更新されます。Last successful authentication
は変更されません。 成功後も変更されませんkinit
。 ただし、成功の場合login
、またはkinit
元のクライアントでは変更されます。 これは別の問題かもしれませんが、両方のサイトで完全に機能する古いユーザーでも同じことが起こります。 を使用すると、getprinc
古いユーザーと新しいユーザーの違いがわかりません。
次の PAM 設定は、Debian インストールのデフォルトとしてlogin
有効になります。auth
account
auth optional pam_faildelay.so delay=3000000
auth requisite pam_nologin.so
auth [success=2 default=ignore] pam_krb5.so minimum_uid=1000
auth [success=1 default=ignore] pam_unix.so nullok try_first_pass
auth requisite pam_deny.so
auth required pam_permit.so
auth optional pam_group.so
account [success=1 new_authtok_reqd=done default=ignore] pam_unix.so
account requisite pam_deny.so
account required pam_permit.so
account required pam_krb5.so minimum_uid=1000
私は、VPN 経由でオリジナルの Kerberos と LDAP を使用する新しい Bullseye クライアントをセットアップしました。同じ動作を示します。私は PAM のデバッグをいくつか行いました:
Jan 23 21:32:44 psyche login[2861]: pam_krb5(login:auth): user user authenticated as [email protected]
Jan 23 21:32:44 psyche login[2861]: pam_unix(login:account): expired password for user user (password aged)
Jan 23 21:32:53 psyche login[2861]: pam_krb5(login:chauthtok): user user changed Kerberos password
Jan 23 21:32:53 psyche login[2861]: pam_unix(login:session): session opened for user user(uid=10##) by admin(uid=0)
すべてのシステムで正常に動作する古いユーザーにはエントリがないため(login:account)
、当然パスワードの変更はありません。したがって、これはレプリケーションとは関係ないようです。login
それらのユーザーに対して正常に動作するシステムがあることはさらに奇妙です。確認しました/etc/pam.d/common-account
が、両方のシステムで同じです。
何をチェックすればよいかについてのアイデアがあれば、ぜひ教えてください。
ご協力いただきありがとうございます。
答え1
実際の理由は Kerberos とは無関係でした。失敗したアカウントはshadowMax
LDAP に設定されていました。そもそもこの設定に気づいていませんでしたが、shadowLastChange
plus がshadowMax
現在の日付より後であっても、資格情報は期限切れとして報告されます。shadowMax
-1 に設定するか、値を完全に削除すると、問題は解決します。
これでは、他のサイトでの設定が明らかに値を完全に無視している理由を完全には説明できませんが、これは別の話です。