更改 ssh-keygen 中的預設憑證簽署演算法

更改 ssh-keygen 中的預設憑證簽署演算法

目前,OpenSSH 7.8 (Fedora 28/Arch) 無法使用憑證簽署金鑰與 OpenSSH 7.4 (CentOS 7) 伺服器進行協商,如下所述在 Redhat 的 bugzilla 上提交的錯誤中OpenSSH 發行說明指示現在必須明確定義簽名協商演算法的變更。雖然現在允許使用 2 個新的簽名演算法(自 7.7 起),但這是一個錯誤或有意為之,[電子郵件受保護]使用者憑證不再能夠用於身份驗證。

重現步驟:

  1. ssh-keygen -t rsa -b 2048 -f 測試
  2. ssh-keygen -s cert.key -I "signedcert" -n testuser test.pub
  3. ssh -i 測試 -vvv 使用者@serverip

我試圖透過修改憑證簽署過程中使用的演算法來解決此問題。

ssh-keygen -L -f test.crt
test.crt:
    Type: [email protected] user certificate
    Public key: RSA-CERT SHA256:<fingerprint>
    Signing CA: RSA SHA256:<fingerprint>

ssh-keygen 的預設值是登入金鑰[電子郵件受保護]

根據 OpenSSH 7.8 文檔,PROTOCOL.certkeys。

All certificate types include certification information along with the
public key that is used to sign challenges. In OpenSSH, ssh-keygen
performs the CA signing operation.

Certified keys are represented using new key types:

    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]

Two additional types exist for RSA certificates to force use of
SHA-2 signatures (SHA-256 and SHA-512 respectively):

    [email protected]
    [email protected]

這告訴我有 7 種可用的金鑰類型,我如何在 ssh-keygen 憑證簽署過程中指定一種。

請注意:

這裡有兩種可能的解決方案。

  1. 找到合適的解決方法以允許[電子郵件受保護] 再次用戶證書。
  2. 找到一種方法來更改 ssh-keygen 中的憑證簽署演算法。

更新:(1天後)

據 #openssh 上的用戶聲稱,憑證簽署演算法是由用於簽署私鑰的金鑰設定的。這意味著,如果我能弄清楚如何將 RSA 演算法從 RSA:SHA1 更改為 RSA:SHA2,我也許能夠強制憑證簽署演算法為 sha2-256,這在雙方都可以透過額外的解決方法實現。

更新:(12天後)

看著提交的錯誤報告,幾乎沒有任何進展……或者看起來是這樣。我能夠與一位 RHEL 員工進行非正式對話,他查看了我的錯誤並表示合適的人正在查看它,並且由於這也影響了 RHEL,因此很可能會在 RHEL/CentOS 7.6 中進行修復

答案1

連結文章記錄了以下方法:

ssh-keygen -s cert.key -I "signedcert" -n testuser  -t rsa-sha2-256 test.pub

關鍵是-t rsa-sha2-256參數。

相關內容