
ssh-agent
我在 Windows 上使用 OpenSSH添加帶有使用者憑證的私鑰時遇到問題。當我嘗試新增金鑰ssh-add testkey
並且還有一個可用於該金鑰的使用者憑證(如 )時testkey-cert.pub
,僅將憑證新增至ssh-agent
.
重現步驟:
- 建立新的 RSA 金鑰對
ssh-keygen -f testkey
- 建立 CA 金鑰對用於簽署測試金鑰
ssh-keygen -f ca
- 簽署測試金鑰
ssh-keygen -s ca -I testkey testkey.pub
- 將測試金鑰新增至 SSH 代理
ssh-add testkey
- 列出新增的按鍵以檢查結果
ssh-add -l
僅RSA-CERT
新增到代理中。
PS C:> ssh-add testkey
Identity added: testkey (testkey)
Certificate added: testkey-cert.pub (testkey)
PS C:> ssh-add -l
2048 SHA256:vaqqEObTRX5icClKdRsEvyut5G1ug9C8uBjJ1TrCx9w testkey (RSA-CERT)
當我在 Linux 上執行這些步驟時,RSA 金鑰和證書都已新增
$ ssh-add test
Identity added: test (test)
Certificate added: test-cert.pub (id_rsa)
$ ssh-add -l
2048 SHA256:3bhXQ3lSdSejjvecm2XtMBa46XiyqFaC70pLibgILMo test (RSA)
2048 SHA256:3bhXQ3lSdSejjvecm2XtMBa46XiyqFaC70pLibgILMo test (RSA-CERT)
這是 Windows 版 OpenSSH 用戶端的問題嗎?
感謝你並致以真誠的問候
答案1
做一些死靈術:我偶然發現了同樣的問題。
我的解決方案:將憑證移出資料夾 ssh-add private_key 將憑證移回 .ssh