無法在 OSX 10.7 上使用 SSH Kerberos Auth 連線到我的伺服器

無法在 OSX 10.7 上使用 SSH Kerberos Auth 連線到我的伺服器

我剛剛將 Mac 作業系統升級到 10.7 Lion。以前效果很好。但是,kinit現在只能正常工作,我無法 ssh 到我的伺服器。

重新安裝「Mac OS X Kerberos Extras」後,情況並沒有好轉。

我的命令:

ssh [email protected] -v

......

debug1: Authentications that can continue: gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1:  Miscellaneous failure (see text)
UNKNOWN_SERVER while looking up 'host/[email protected]' (cached result, timeout in 1200 sec)

debug1:  An invalid name was supplied
unknown mech-code 0 for mech 1 2 752 43 14 2

debug1:  Miscellaneous failure (see text)
unknown mech-code 0 for mech 1 3 6 1 5 5 14

debug1: Authentications that can continue: gssapi-with-mic,password
debug1:  An unsupported mechanism was requested
unknown mech-code 0 for mech 1 3 5 1 5 2 7

debug1:  Miscellaneous failure (see text)
unknown mech-code 0 for mech 1 3 6 1 5 2 5

debug1: Next authentication method: password
[email protected]'s password:

答案1

~/.ssh/config您的文件或 ? 中是否有以下兩行/etc/ssh_config

GSSAPIAuthentication yes
GSSAPITrustDNS yes

第一個需要啟用 GSSAPI (Kerberos) 驗證,第二個需要讓 ssh 透過 DNS 規範化主機名稱並使用規格名稱取得主機服務票證。如果沒有第二個,ssh 將使用在命令列中輸入的確切主機名稱或 IP 位址來嘗試取得主機服務票證,在這種情況下會失敗:

尋找“主機/”時出現 UNKNOWN_SERVER[電子郵件受保護]'

主體的實際名稱通常是“host/hostname.domain@REALM”,而不是 IP 位址。當然,您需要正確的反向 DNS 設定才能使其正常運作。

OS X 似乎也無法偵測到要使用的正確域名,並嘗試使用 IP 位址(「@3.18.211」部分)。您是否為您的領域和 KDC 設定了正確的 DNS TXT 和 SRV 記錄?如果沒有,您需要在 中手動輸入預設領域和 KDC 位址/etc/krb5.conf

答案2

我在連接到 Centos 時遇到了這些錯誤,但在連接到 fedora 時卻沒有。透過將我的 User 更改為完整的 userPrincipalName 而不是 OS X 上的短名來解決。

〜/ .ssh /配置:

Host svn saturnus.lan
User [email protected]

SSH 未知機械代碼錯誤:

debug1: Next authentication method: gssapi-with-mic
debug2: we sent a gssapi-with-mic packet, wait for reply
debug1: Delegating credentials
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1:  An invalid name was supplied
unknown mech-code 0 for mech 1 2 752 43 14 2

debug1:  Miscellaneous failure (see text)
unknown mech-code 0 for mech 1 3 6 1 5 5 14

debug2: we sent a gssapi-with-mic packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1:  An unsupported mechanism was requested
unknown mech-code 0 for mech 1 3 5 1 5 2 7

debug1:  Miscellaneous failure (see text)
unknown mech-code 0 for mech 1 3 6 1 5 2 5

debug2: we did not send a packet, disable method

相關內容