我想通过Kerberos SSO与SSH进行身份验证。现在,当我使用我的用户主体登录时,我sourcehost
得到了Kerberos票证,但无法将其用于SSH进入targethost
。
问题似乎是主机名。我有一个主机主体host/[email protected]
,但如果我不管ssh targethost
或者ssh targethost.example.com
它被翻译成主机主体host/[email protected]
(见下面的错误消息),它不存在。
我可能是错的,但我认为这应该是周围的其他方式都ssh targethost
和ssh targethost.example.com
应该被翻译成主机主体host/[email protected]
。
这是错误:
$ ssh targethost.example.com -v
...
debug1: Unspecified GSS failure. Minor code may provide more information
Server host/[email protected] not found in Kerberos database
debug1: Unspecified GSS failure. Minor code may provide more information
Server host/[email protected] not found in Kerberos database
debug1: Unspecified GSS failure. Minor code may provide more information
...
debug1: Next authentication method: password
[email protected]'s password:
有人可以解释主机主体如何从主机名派生以及如何进行配置(顺便说一句,我在Ubuntu上)?
编辑:
grawity的回答使我找到了一种解决方案,我认为这对我的配置是一个很好的解决方案。
因此,在使用kdadmin.local
/addprinc
与FQDN创建主机主体之后,我必须通过运行ldapmodify
以下输入为LDAP中的新主体条目添加别名:
dn: krbPrincipalName=host/[email protected],cn=EXAMPLE.COM,cn=krbContainer,dc=example,dc=com
replace: krbCanonicalName
krbCanonicalName: host/[email protected]
-
add: krbPrincipalName
krbPrincipalName: host/[email protected]
传统上,Kerberos使用反向DNS规范化主体名称。也就是说,在解析targethost.example.com
为IP地址之后,它将尝试将地址解析回“规范”名称,并将其用于委托人。
如果您targethost
是通过解析/ etc / hosts文件,那么首先在相应的线路名称将被用作“规范”的名字:
# good:
1.2.3.4 targethost.example.com targethost
# bad:
1.2.3.4 targethost targethost.example.com
如果需要,可以通过/etc/krb5.conf完全关闭基于DNS的规范化:
[libdefaults]
dns_canonicalize_hostname = false
...并简单地为主机创建两个主体-一个用于短名称,一个用于长名称。(这实际上是Active Directory的功能,与SSL / TLS的行为并无不同-直接使用用户输入而不是询问DNS总是更安全。)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句