PAM LDAP:passwdコマンドに「(現在)LDAPパスワード:」が必要なのはなぜですか?

PAM LDAP:passwdコマンドに「(現在)LDAPパスワード:」が必要なのはなぜですか?

Debian 11サーバーにopenLDAPサービスがあり、Ubuntu 22.04 PCにPAMが設定されていますが、混乱し始めました。何の問題もなくログインできますが、パスワードを変更しようとすると奇妙な動作が発生します。最初はパスワードを変更できましたが、まずパスワードを入力する必要がありLDAP Password、その後に新しいパスワードを2回入力して再入力するように求められます。

ただし、少し操作した後は次/etc/pam.d/common-passwordのようになります。

#
# /etc/pam.d/common-password - password-related modules common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of modules that define the services to be
# used to change user passwords.  The default is pam_unix.

# Explanation of pam_unix options:
# The "yescrypt" option enables
#hashed passwords using the yescrypt algorithm, introduced in Debian
#11.  Without this option, the default is Unix crypt.  Prior releases
#used the option "sha512"; if a shadow password hash will be shared
#between Debian 11 and older releases replace "yescrypt" with "sha512"
#for compatibility .  The "obscure" option replaces the old
#`OBSCURE_CHECKS_ENAB' option in login.defs.  See the pam_unix manpage
#for other options.

# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
# local modules either before or after the default block, and use
# pam-auth-update to manage selection of other modules.  See
# pam-auth-update(8) for details.

# here are the per-package modules (the "Primary" block)
#password requisite     pam_pwquality.so retry=3
#password [success=2 default=ignore]  pam_unix.so obscure use_authtok try_first_pass yescrypt
password  [success=2 default=ignore]  pam_unix.so obscure try_first_pass yescrypt debug
#password sufficient      pam_sss.so use_authtok
password  [success=1 default=ignore]  pam_ldap.so minimum_uid=1000 use_authtok debug
# here's the fallback if no module succeeds
password  requisite     pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
password  required      pam_permit.so
# and here are more per-package modules (the "Additional" block)
password  optional  pam_gnome_keyring.so
# end of pam-auth-update config

パスワードを変更しようとすると、次のことがわかりました。

(base) jan@enki:~$ passwd
(current) LDAP Password: 
passwd: Authentication token manipulation error
passwd: password unchanged

これは次のとおりです/var/log/auth.log(他の端末を起動した後にEnterを数回押したため、出力に空白行が表示されましたpasswd)。

(base) root@enki:/var/log# tail -f auth.log
...
Jan 27 16:12:59 enki passwd[392340]: pam_unix(passwd:chauthtok): username [jan] obtained
Jan 27 16:12:59 enki passwd[392340]: pam_unix(passwd:chauthtok): user "jan" does not exist in /etc/passwd
Jan 27 16:12:59 enki passwd[392340]: pam_ldap(passwd:chauthtok): nslcd request config (1)
Jan 27 16:12:59 enki passwd[392340]: pam_ldap(passwd:chauthtok): nslcd account check; user=jan


Jan 27 16:13:05 enki passwd[392340]: pam_ldap(passwd:chauthtok): nslcd authentication; user=jan
Jan 27 16:13:05 enki passwd[392340]: pam_ldap(passwd:chauthtok): authentication succeeded
Jan 27 16:13:05 enki passwd[392340]: pam_unix(passwd:chauthtok): username [jan] obtained
Jan 27 16:13:05 enki passwd[392340]: pam_unix(passwd:chauthtok): user "jan" does not exist in /etc/passwd
Jan 27 16:13:05 enki passwd[392340]: pam_ldap(passwd:chauthtok): nslcd request config (1)
Jan 27 16:13:05 enki passwd[392340]: pam_ldap(passwd:chauthtok): nslcd account check; user=jan
...

pam_ldap認証が成功したようですが、なぜ失敗するのでしょうか?第二に、新しいパスワードを2回尋ねるのはなぜですか?

ベストアンサー1

おすすめ記事