OpenSSH 伺服器

OpenSSH 9.0 起預設 sntrup761x25519(非 NIST 標準),9.9 加入 mlkem768x25519-sha256,10.0 起改為預設。

前提:符合 FIPS 203 需要 OpenSSH 9.9 以上

步驟

  1. `ssh -V` 或本工具的 banner 確認版本。Ubuntu 24.04 是 9.6,只有 sntrup761x25519。
  2. 9.9 以上若 KexAlgorithms 有自訂清單,把 mlkem768x25519-sha256 放第一位。
  3. 低於 9.9 需要升級作業系統或 OpenSSH 套件;在那之前 sntrup761x25519 仍提供後量子保護。
  4. `sshd -t` 檢查設定後重新載入,保留一個已登入的工作階段以防鎖在門外。

設定片段

# /etc/ssh/sshd_config.d/50-pqc.conf
KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org

注意

驗證:pqc-doctor ssh <host>

實測依據:2026-11-24 lab:Ubuntu 24.04 OpenSSH 9.6 只有 sntrup761 且 mlkem 設定被 sshd -t 拒絕;Alpine 3.21 OpenSSH 9.9 有 mlkem 但伺服器清單 sntrup 在前,套用片段後 mlkem 第一;Alpine 3.24 OpenSSH 10.3 預設 mlkem 第一

參考