
當從本機 powershell 執行certutil
請求時,一切正常。
PS C:\Users\admuser> certutil -ping -config 'caserver\ca'
Connecting to caserver\ca ...
Server "ca" ICertRequest2 interface is alive (32ms)
CertUtil: -ping command completed successfully.
PS C:\Users\admuser>
從使用 OpenSSH 連接到相同 Windows 伺服器的 Linux 主機執行相同的操作,我們會收到錯誤。
PS C:\Users\admuser> certutil -ping -config 'caserver\ca'
Connecting to caserver\ca ...
Server could not be reached: The RPC server is unavailable. 0x800706ba (WIN32: 1722 RPC_S_SERVER_UNAVAILABLE) -- (16ms)
CertUtil: -ping command FAILED: 0x800706ba (WIN32: 1722 RPC_S_SERVER_UNAVAILABLE)
CertUtil: The RPC server is unavailable.
PS C:\Users\admuser>
透過 ssh 連接然後執行命令(兩者都是從本地 powershell 執行)有什麼問題嗎?
答案1
這裡的問題是使用 ssh 金鑰進行身份驗證。如果您這樣做,您將無法使用進一步的身份驗證,這是certutil
RPC 服務所需要的。 MS 記錄的這種行為有些隱藏。
https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement
透過基於金鑰的身份驗證開啟的遠端會話沒有關聯的使用者憑證,因此無法作為使用者進行出站身份驗證,這是設計使然。
因此,如果您需要針對 MS 生態系統進行進一步的身份驗證,您將無法使用基於金鑰的身份驗證。您必須使用 ssh 的使用者名稱和密碼。