I've been poking at this for a while... basically, I've got a server I've migrated from an older system that worked (copied the slapd.conf file over) and ran with it for several months before realizing that kerberos auth wasn't working... and all my local network clients were working off of cached credentials because they couldn't authenticate to my ldap server. Time to solve that...
Current state:
Machine is running FreeBSD 13.1-RELEASE under a jail, using the ports version of openldap24-server with GSSAPI enabled.
Within the jail, I have /etc/rc.conf with the following relevant contents:
I have installed cyrus-sasl2-saslauthd, and have the following under /usr/local/lib/sasl2/slapd.conf
I've also changed group ownership of /var/run/saslauthd to ldap and granted read and execute rights to that group. In addition, I have the following in my keytab as defined in the rc.conf above:
The keytab is granted read access to the ldap group. I have the following in my /usr/local/etc/openldap/slapd.conf:
... and yet, when I attempt to run
From what I've been reading, this is usually caused by the server not having access to the keytab... but from the above, I'm fairly sure it does (unless the line
EDIT: For reference, here's what I get when I run
EDIT2: A relevant log snippet may also help:
That's what I get when I run the
Current state:
Machine is running FreeBSD 13.1-RELEASE under a jail, using the ports version of openldap24-server with GSSAPI enabled.
Within the jail, I have /etc/rc.conf with the following relevant contents:
Code:
slapd_enable="YES"
slapd_flags='-h "ldapi://%2fvar%2frun%2fopenldap%2fldapi/ ldap://10.4.12.23"'
slapd_sockets="/var/run/openldap/ldapi"
slapd_krb5_ktname="FILE:/etc/krb5.keytab"
saslauthd_enable="YES"
saslauthd_flags="-a kerberos5"
Code:
mech_list: plain GSSAPI
pwcheck_method: saslauthd
saslauthd_path: /var/run/saslauthd/mux
Code:
root@ldap1:/usr/ports # ktutil -k /etc/krb5.keytab list
/etc/krb5.keytab:
Vno Type Principal Aliases
10 aes256-cts-hmac-sha1-96 host/ldap1.example.com@EXAMPLE.COM
9 aes256-cts-hmac-sha1-96 ldap/ldap1.example.com@EXAMPLE.COM
Code:
sasl-realm EXAMPLE.COM
sasl-host ldap1.example.com
authz-policy from
authz-regexp uid=([^/]*),cn=EXAMPLE.COM,cn=GSSAPI,cn=auth
uid=$1,ou=Users,dc=example,dc=com,o="Example Org"
ldapwhoami -H ldap://ldap1.example.com -Y GSSAPI
(after running kinit
), I get the following:
Code:
SASL/GSSAPI authentication started
ldap_sasl_interactive_bind_s: Other (e.g., implementation specific) error (80)
additional info: SASL(-1): generic failure: GSSAPI Error: No credentials were supplied, or the credentials were unavailable or inaccessible. (unknown mech-code 0 for mech unknown)
slapd_krb5_ktname="FILE:/etc/krb5.keytab"
is being ignored... is there a way to check that?)EDIT: For reference, here's what I get when I run
klist
:
Code:
Ticket cache: FILE:/tmp/krb5cc_1500_mhG6Qa
Default principal: myuser@EXAMPLE.COM
Valid starting Expires Service principal
10/24/2022 13:37:08 10/25/2022 05:37:08 krbtgt/EXAMPLE.COM@EXAMPLE.COM
renew until 10/25/2022 13:37:52
10/24/2022 13:37:15 10/25/2022 05:37:08 nfs/mynfsserver.example.com@EXAMPLE.COM
renew until 10/25/2022 13:37:52
10/24/2022 14:09:06 10/25/2022 05:37:08 ldap/ldap1.example.com@EXAMPLE.COM
renew until 10/25/2022 13:37:52
EDIT2: A relevant log snippet may also help:
Code:
Oct 24 14:41:57 jailer.example.com slapd[4793]: conn=1086 fd=12 ACCEPT from IP=10.4.12.200:37678 (IP=10.4.12.23:389)
Oct 24 14:41:57 jailer.example.com slapd[4793]: conn=1086 op=0 BIND dn="" method=163
Oct 24 14:41:57 jailer.example.com slapd[4793]: SASL [conn=1086] Failure: GSSAPI Error: No credentials were supplied, or the credentials were unavailable or inaccessible. (unknown mech-code 0 for mech unknown)
Oct 24 14:41:57 jailer.example.com slapd[4793]: conn=1086 op=0 RESULT tag=97 err=80 text=SASL(-1): generic failure: GSSAPI Error: No credentials were supplied, or the credentials were unavailable or inaccessible. (unknown mech-code 0 for mech unknown)
Oct 24 14:41:57 jailer.example.com slapd[4793]: conn=1086 op=1 UNBIND
Oct 24 14:41:57 jailer.example.com slapd[4793]: conn=1086 fd=12 closed
ldapwhoami
query.