我正在尝试在 Centos 6.3 上使用 ldap 后端运行 kerberos,创建 Realm 之后:
kdb5_ldap_util -D "cn=admin,dc=example,dc=com" create -sscope sub -sf /var/kerberos/krb5kdc/example_stash.keyfile -r EXAMPLE.COM -s
我正在尝试运行kdc
并得到:
Starting Kerberos 5 KDC: krb5kdc: cannot initialize realm EXAMPLE.COM - see log file for details
日志显示这样的错误:
krb5kdc: Error reading password from stash: Bind DN entry missing in stash file - while initializing database for realm EXAMPLE.COM
krb5.conf
文件:
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
default_realm = EXAMPLE.COM
dns_lookup_realm = false
dns_lookup_kdc = false
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
[realms]
EXAMPLE.COM = {
kdc = kerberos.example.com
admin_server = kerberos.example.com
master_kdc = kerberos.example.com
default_domain = example.com
database_module = ldap_example
}
[domain_realm]
.example.com = EXAMPLE.COM
example.com = EXAMPLE.COM
kerberos.example.com = EXAMPLE.COM
[appdefaults]
pam = {
debug = true
ticket_lifetime = 36000
renew_lifetime = 36000
forwardable = true
krb4_convert = false
}
[dbmodules]
ldap_example = {
db_library = kldap
## DN for the global Kerberos container entry
ldap_kerberos_container_dn = ou=kerberos,ou=Services,dc=example,dc=com
ldap_kdc_dn = cn=krbadmin,ou=Services,dc=example,dc=com ## this object needs to have READ rights on the realm container, principal container and realm sub-trees
ldap_kadmind_dn = "cn=krbadmin,ou=Services,dc=example,dc=com" ## this object needs to have READ and WRITE rights on the realm container, principal container and realm sub-trees
ldap_service_password_file = /var/kerberos/krb5kdc/example_stash.keyfile
ldap_servers = ldap://kerberos.example.com
ldap_conns_per_server = 5
}
ou=kerberos,ou=Services,dc=example,dc=com
和都cn=krbadmin,ou=Services,dc=example,dc=com
存在。Realm 在 之下ou=kerberos
。kdb5_ldap_util
可以列出它:
kdb5_ldap_util -D cn=admin,dc=example,dc=com list -r EXAMPLE.COM
Password for "cn=admin,dc=example,dc=com":
EXAMPLE.COM
存储文件是新创建的,在创建领域之前不存在。我已经尝试询问 Uncle,但没有成功。
答案1
使用 OpenLDAP 后端时,与领域一起创建的存储文件无用,因为它不包含 DN。它看起来像独立的存储文件。
您必须使用以下命令创建存储文件:
kdb5_ldap_util -D "cn=admin,dc=example,dc=com" stashsrvpw -f /var/kerberos/krb5kdc/example_stash.keyfile "cn=krbadmin,ou=Services,dc=example,dc=com"
另一件事是 krb5.conf 不支持内联注释。