SSH 用户未通过 Kerberos 进行身份验证

SSH 用户未通过 Kerberos 进行身份验证

我已经在我的 ubuntu 机器上设置了 kerberos,并且我能够通过kinit我的其他 Fedora Linux 客户端机器为用户获取票证。

但是在 sshd 调试日志中出现以下错误,不知道这意味着什么:

debug1: userauth-request for user user1 service ssh-connection method gssapi-with-mic [preauth]
debug1: attempt 1 failures 0 [preauth]
Postponed gssapi-with-mic for user1 from 10.87.198.85 port 55360 ssh2 [preauth]
debug1: Unspecified GSS failure.  Minor code may provide more information
Request ticket server host/[email protected] found in keytab but does not match server principal host/sat.com@

debug1: Got no client credentials
debug1: userauth-request for user user1 service ssh-connection method gssapi-with-mic [preauth]
debug1: attempt 2 failures 1 [preauth]

我的 sshd 和 KDC 在同一台机器上运行,配置如下:

krb5.conf的主要组成部分:

[libdefaults]
        default_realm = SAT.COM

[realms]
        SAT.COM = {
                kdc = kdc.sat.com
                admin_server = kdc.sat.com
        }

我的 /etc/hosts 文件:

127.0.0.1       localhost
10.125.222.30   kdc.sat.com


# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

我的 KDC 中的负责人如下:

kadmin:  listprincs 
K/[email protected]
host/[email protected]
host/[email protected]
kadmin/[email protected]
kadmin/[email protected]
kadmin/[email protected]
kiprop/[email protected]
krbtgt/[email protected]
satyam/[email protected]
[email protected]

当我从我的 fedora 客户端执行初始 kinit 时,我只收到一张票,如下所示:

[user1@satyam ~]$ kinit 
Password for [email protected]: 
[user1@satyam ~]$ klist 
Ticket cache: KCM:1001
Default principal: [email protected]

Valid starting       Expires              Service principal
09/24/2019 19:32:46  09/25/2019 05:32:46  krbtgt/[email protected]
    renew until 10/01/2019 19:32:41

但是,只要我通过 ssh 连接到与 KDC 服务器相同的 sshd 服务器,我的 klist 就会有更多条目:

[user1@satyam ~]$ ssh kdc.sat.com
Ubuntu 16.04.1 LTS Satyam
[email protected]'s password: 

    [satyam@satyam ~]$ klist 
Ticket cache: KCM:1000
Default principal: [email protected]

Valid starting       Expires              Service principal
09/24/2019 19:44:59  09/25/2019 05:41:14  host/kdc.sat.com@
    renew until 10/01/2019 19:41:10
09/24/2019 19:41:14  09/25/2019 05:41:14  krbtgt/[email protected]
    renew until 10/01/2019 19:41:10
09/24/2019 19:44:59  09/25/2019 05:41:14  host/[email protected]
    renew until 10/01/2019 19:41:10

也是主要主持人/[电子邮件保护]之前没有添加,但是后来我在 sshd 中收到以下错误,所以我尝试添加它,但仍然没有运气:

No key table entry found matching host/sat.com@

与此相关的任何帮助都将非常有帮助。

答案1

我在网上进行了大量谷歌搜索,发现下面的配置参数可以解决这个问题:

我使用的参数:

[libdefaults]
    ignore_acceptor_hostname = true

https://stackoverflow.com/questions/14687245/apache-sends-wrong-server-principal-name-to-kerberos

虽然上面的 SO 线程中有解释,但我仍然不太明白它是如何工作的以及问题是什么。

如果有人能解释一下这个配置参数如何解决我的问题那就太好了。

相关内容