我在我的 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線程中,雖然有一個解釋,但我仍然不太明白它是如何工作的以及問題是什麼。
如果有人能解釋這個配置參數如何解決我的問題,那就太好了。