我正在寻找如何将 GSSAPI 支持添加到我的 OpenLDAP 中?
当前设置
MIT Kerberos V + OpenLDAP
Kerberos bind to openldap
Able to issue kerberos tickets to my users (with kinit exampluser)
Able to ldapsearch -x uid=exampluser
Openldap端
server% ldapsearch -x -H ldapi:/// -b "" -LLL -s base -Z supportedSASLMechanisms
ldap_start_tls: Protocol error (2)
additional info: unsupported extended operation
dn:
supportedSASLMechanisms: DIGEST-MD5
supportedSASLMechanisms: EXTERNAL
supportedSASLMechanisms: CRAM-MD5
supportedSASLMechanisms: NTLM
supportedSASLMechanisms: LOGIN
supportedSASLMechanisms: PLAIN
客户端
client% ldapsearch uid=exampleuser
SASL/GSSAPI authentication started
ldap_sasl_interactive_bind_s: Authentication method not supported (7)
additional info: SASL(-4): no mechanism available: Couldn't find mech GSSAPI
客户端 ldap.conf
#
# LDAP Defaults
#
# See ldap.conf(5) for details
# This file should be world readable but not world writable.
BASE dc=example,dc=com
URI ldap://ldap.example.com
SASL_MECH GSSAPI
显然,错误很清楚,可以解释我的 ldap 请求没有找到验证机制。
我经历了许多教程和解释,但仍然无法找到如何“添加”该机制的任何地方。
谢谢什么是 SASL/GSSAPI?对于所有令人敬畏的解释。
为用户 473183469 更新
我已经为 ldap 生成了一个密钥表,我在/etc/ldap/ldap.keytab中复制了它,并根据https://help.ubuntu.com/community/SingleSignOn编辑了/etc/default/slapd要求取消注释并给出导出 KRB5_KTNAME=/etc/ldap/ldap.keytab的路径
那个 ldap keytab 是这样生成的
kadmin: addprinc -randkey ldap/[email protected]
kadmin: ktadd -k ~/ldap.keytab ldap/[email protected]
我还有一个在安装开始时创建的 /etc/krb5.keytab
kadmin.local: listprincs
[email protected]
K/[email protected]
krbtgt/[email protected]
kadmin/[email protected]
kadmin/[email protected]
kadmin/[email protected]
kadmin/[email protected]
[email protected] (also in the ldap, can issue a ticket and everything)
[email protected] (same for him)
ldap/[email protected]
ktutil 结果
# ktutil
ktutil: read_kt /etc/ldap.keytab
ktutil: list
slot KVNO Principal
---- ---- ---------------------------------------------------------------------
1 2 ldap/[email protected]
2 2 ldap/[email protected]
3 2 ldap/[email protected]
4 2 ldap/[email protected]
ktutil: read_kt /etc/krb5.keytab
ktutil: list
slot KVNO Principal
---- ---- ---------------------------------------------------------------------
1 2 ldap/[email protected]
2 2 ldap/[email protected]
3 2 ldap/[email protected]
4 2 ldap/[email protected]
5 2 kadmin/[email protected]
6 2 kadmin/[email protected]
7 2 kadmin/[email protected]
8 2 kadmin/[email protected]
解决了
我失踪
SASL_MECH GSSAPI
了SASL_REAM
/etc/ldap/ldap.conf
现在我可以直接使用 kerberos 票证 ldapsearch uid=user 并获取
当然,如果我没有 kerberos 票(这是有道理的)
您通常需要更改 slapd 的 sasl 配置
/etc/sasl2/slapd.conf
以包含 gssapi。例如:
之后您需要重新启动 slapd。
您不是只是缺少
/etc/krb5.keytab
具有 SPN 的文件ldap/fdqn
吗?我认为您不需要在 OpenLDAP 上设置任何与 GSSAPI 相关的 SASL 开关,因为默认设置很好,并且强制例如领域比其他更麻烦。