# Post-Quantum SSH and Git Infrastructure: Engineering Around NSA PP-26-4956

> An engineering deep dive into post-quantum and 'post-AI' cryptographic hardening for SSH clients, Ubuntu and Windows OpenSSH servers, short-lived SSH CAs, Git transport, CI OIDC identity and long-term commit provenance.

- URL: https://gigantic.work/engineering/post-quantum-ssh-and-git-hardening/
- Published: 2026-12-03
- Author: Gigantic Work Engineering (Infrastructure & security team)
- Topics: SSH, OpenSSH, Git, Post-Quantum, Post-AI, NSA PP-26-4956, SSH CA, OIDC
- Language: English

The standard DevOps security baseline of the early 2020s — "disable passwords, prefer `ed25519`, keep RSA-2048 for compatibility" — broke on 1–2 December 2026.

NSA Cybersecurity Advisory **PP-26-4956** (*[Immediate Actions to Push Toward Post-Quantum](https://media.defense.gov/2026/Dec/01/2004039413/-1/-1/0/CSA_Immediate_Actions_Push_Toward_PQC.PDF)*), alongside the joint NSA/CISA/ONCD statement and a coordinated backing statement from eight major technology firms (Amazon, Anthropic, Apple, Cloudflare, Google, Microsoft, OpenAI and Oracle) following frontier-AI lab disclosures, reframed cryptographic migration from a 2030s compliance project into immediate engineering work. As Cloudflare CEO Matthew Prince noted publicly after the briefings, *"It is urgent to move encrypted systems to post-quantum (maybe more appropriately called post-AI) standards"* and teams should *"assume anything that uses RSA or Elliptic Curve cryptography"* may face shortened timelines.

This engineering note sets out the concrete architecture and configuration baselines we apply across client SSH estates, Ubuntu and Windows OpenSSH servers, and Git/CI pipelines.

<div class="callout callout-tip">
  <div class="callout-title">Core architectural rule</div>
  <p>Separate <strong>forward-confidentiality key exchange</strong> (deploy hybrid ML-KEM immediately to stop Harvest Now, Decrypt Later) from <strong>identity &amp; private keys</strong> (eliminate RSA &lt; 3072, SHA-1 <code>ssh-rsa</code> and unrotated 256-bit-only dependencies, and replace static key sprawl with short-lived certificates and OIDC).</p>
</div>

---

## 1. Primitive-level threat model: why private keys cannot wait

Waiting for public cryptanalytic papers fails whenever **static public keys are already public**. Unlike ephemeral session parameters, public keys for SSH hosts (`known_hosts` / DNS SSHFP), developer accounts (`github.com/<user>.keys`), signed Git commits and SAML metadata sit indexed indefinitely. Once an AI-assisted or quantum attack shortens key recovery against classical discrete-logarithm or factoring assumptions, any unrotated private key paired with an exposed public key becomes valid for impersonation immediately.

PP-26-4956 reflects two converging pressures:

1. **Quantum risk (Shor's &amp; Grover's algorithms):** Breaks RSA, finite-field Diffie-Hellman and all elliptic curves (`P-256`, `P-384`, `X25519`, `Ed25519`) retroactively against captured traffic.
2. **Post-AI / classical curve risk read between the lines of PP-26-4956:** PP-26-4956 explicitly tells operators to inventory and flag **DSA**, **EdDSA** (`Ed25519`), **pairing-based cryptography**, and **elliptic curves other than P-384 or P-521** — putting `P-256`, `X25519` and `Ed25519` under immediate scrutiny while allowing **RSA-3072+** and **P-384** as temporary classical stopgaps en route to **ML-KEM** (FIPS 203) and **ML-DSA** (FIPS 204).

### Hybrid (`PQ + Traditional`) design rule

During transition, **hybrid algorithms** (`mlkem768x25519-sha256` for key exchange; `ssh-mldsa44-ed25519` for authentication) combine a classical primitive with a NIST-standardised lattice primitive so both must fall for the session or signature to break:

| Primitive role | Legacy / flagged | Interim CNSA / forge bridge | Hybrid PQ / CNSA 2.0 target |
| :--- | :--- | :--- | :--- |
| **SSH KEX** | `diffie-hellman-group14-sha256`, `ecdh-sha2-nistp256`, `curve25519-sha256` alone | `sntrup761x25519-sha512@openssh.com` | `mlkem768x25519-sha256` (default in OpenSSH 10.0+) |
| **SSH host / user auth** | `ssh-rsa` (SHA-1), `ssh-dss`, RSA-1024/2048, standalone unrotated `ssh-ed25519` | `sk-ecdsa-sha2-nistp256@openssh.com` (FIDO2), `ecdsa-sha2-nistp384`, `rsa-sha2-512` (&ge; 3072-bit) | `ssh-mldsa44-ed25519` (OpenSSH 10.6+) or short-lived SSH CA certs |
| **TLS 1.3 transport** | RSA key exchange, ECDHE P-256 only | TLS 1.3 + RSA-3072+ / P-384 cert | `X25519MLKEM768` / `SecP384r1MLKEM1024` + ML-DSA-87 / MTC |
| **Symmetric / hash** | 3DES, RC4, AES-128, SHA-1, MD5 | AES-256-GCM / ChaCha20-Poly1305, SHA-256 | AES-256-GCM, SHA-384 / SHA-512 |

---

## 2. OpenSSH 9.0 to 10.6: protocol timeline and the 10.6 key-rename pitfall

Understanding exact OpenSSH version behaviour prevents broken deployments across heterogeneous client and server fleets:

| OpenSSH version | Shipped on (typical) | Key security &amp; PQ milestones | Operational gotcha |
| :--- | :--- | :--- | :--- |
| **8.9** | Ubuntu 22.04 LTS | Removed `ssh-rsa` default | Zero PQ key exchange; vulnerable to HNDL |
| **9.0** | Debian 12, macOS Ventura+ | Added default hybrid `sntrup761x25519-sha512@openssh.com` | Pre-standard NTRU Prime; lacks NIST ML-KEM |
| **9.6** | Ubuntu 24.04 LTS | `sntrup761x25519-sha512@openssh.com`, `RequiredRSASize` | Still lacks `mlkem768x25519-sha256`; OpenSSL 3.0 base |
| **9.9 / 10.0** | Early 2025 upstreams | Added &amp; defaulted `mlkem768x25519-sha256` | Older Win32-OpenSSH / macOS clients fall back to classical KEX |
| **10.1** | Late 2025 / Homebrew | Client `WarnWeakCrypto` defaults to `yes` | Emits SLDL warning on GitHub/GitLab/Ubuntu servers lacking PQ KEX |
| **10.2–10.3** | Ubuntu 26.04 LTS, OpenBSD 7.8–7.9 | `mlkem768x25519-sha256` mature default | Good server baseline; still lacks promoted ML-DSA host keys |
| **10.4–10.5** | Mid-2026 Homebrew / bleeding edge | Experimental `mldsa44-ed25519@openssh.com` | **Vendor-suffixed keys incompatible with 10.6+** |
| **10.6** | Oct 2026+ OpenBSD / Homebrew | Promoted **`ssh-mldsa44-ed25519`**; server-side `WarnWeakCrypto` | **Crash hazard:** `sshd` refuses to start if `10.4/10.5` `@openssh.com` keys remain configured |

### The 10.4/10.5 to 10.6 upgrade crash

If an operator tested `ssh-keygen -t mldsa44-ed25519@openssh.com` on OpenSSH 10.4 or 10.5 and upgraded to 10.6, the key type string changed to `ssh-mldsa44-ed25519` with an updated wire encoding. Leftover `@openssh.com` host keys cause `sshd` to abort on startup (`Could not load host key`), and stale entries in `known_hosts` or `authorized_keys` fail verification. Always scrub experimental keys before upgrading and run `sudo ssh-keygen -A && sudo sshd -t`.

---

## 3. Production SSH baselines: Ubuntu, Windows and mixed clients

### A. Server drop-in (`/etc/ssh/sshd_config.d/99-pqc-hardening.conf`)

Ubuntu 24.04 (`OpenSSH 9.6`) and Ubuntu 26.04 (`OpenSSH 10.2+`) load `/etc/ssh/sshd_config.d/*.conf` alphabetically. Note that on mixed fleets containing Ubuntu 24.04 servers, including `sntrup761x25519-sha512@openssh.com` keeps PQ KEX active across both 24.04 and 26.04 until 24.04 hosts are upgraded or placed behind a 26.04 bastion:

```ssh-config
# /etc/ssh/sshd_config.d/99-pqc-hardening.conf
KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512@openssh.com

# Uncomment HostKey for OpenSSH 10.6+ hosts after running `sudo ssh-keygen -A`:
# HostKey /etc/ssh/ssh_host_mldsa44_ed25519_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_rsa_key

HostKeyAlgorithms ssh-mldsa44-ed25519,ecdsa-sha2-nistp384,rsa-sha2-512,rsa-sha2-256
PubkeyAcceptedAlgorithms ssh-mldsa44-ed25519,sk-ecdsa-sha2-nistp256@openssh.com,ecdsa-sha2-nistp384,rsa-sha2-512,rsa-sha2-256

# Reject legacy 1024/2048-bit RSA host and user keys outright
RequiredRSASize 3072

# Log weak classical fallbacks (OpenSSH 10.6+)
# WarnWeakCrypto yes

PasswordAuthentication no
KbdInteractiveAuthentication no
PermitRootLogin prohibit-password
AllowTcpForwarding local
X11Forwarding no
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com
```

### B. Client policy (`~/.ssh/config`)

Notice how `RequiredRSASize 3072` behaves on clients: if a server presents an RSA-2048 host key, the OpenSSH client **aborts the handshake immediately** (the SSH protocol cannot renegotiate a host key mid-connection). Meanwhile, `WarnWeakCrypto yes` ensures operators see falling back to classical KEX rather than hiding HNDL risk:

```ssh-config
Host *
    KexAlgorithms mlkem768x25519-sha256,sntrup761x25519-sha512@openssh.com,ecdh-sha2-nistp384
    RequiredRSASize 3072
    WarnWeakCrypto yes
    HostKeyAlgorithms ssh-mldsa44-ed25519,ecdsa-sha2-nistp384,rsa-sha2-512,rsa-sha2-256
    PubkeyAcceptedAlgorithms ssh-mldsa44-ed25519,sk-ecdsa-sha2-nistp256@openssh.com,ecdsa-sha2-nistp384,rsa-sha2-512,rsa-sha2-256
    IdentitiesOnly yes
    IdentityFile ~/.ssh/id_mldsa44_ed25519
    IdentityFile ~/.ssh/id_ecdsa_p384
    IdentityFile ~/.ssh/id_rsa_4096

# Per-host exception for tracked legacy gear scheduled for containment
Host legacy-san-01.internal
    WarnWeakCrypto no-pq-kex
    RequiredRSASize 2048
```

### C. Windows OpenSSH (`Win32-OpenSSH`) pitfalls

Microsoft's inbox OpenSSH binary under `C:\Windows\System32\OpenSSH\` ships with Windows servicing cycles and routinely trails upstream PQ releases. Engineering teams supporting Windows developers or Windows servers should standardise three controls:

1. **Replace the client binary:** Install current `PowerShell/Win32-OpenSSH` (`winget install Microsoft.OpenSSH.Beta`) or execute SSH inside **WSL2 (Ubuntu 26.04)**.
2. **Override Git-for-Windows:** Force Git to stop using its bundled MSYS2 `ssh.exe`:
   `git config --global core.sshCommand "C:/Program Files/OpenSSH/ssh.exe"`.
3. **Audit `administrators_authorized_keys` on Windows servers:** Default `C:\ProgramData\ssh\sshd_config` routes members of `BUILTIN\Administrators` away from `%USERPROFILE%\.ssh\authorized_keys` into `C:\ProgramData\ssh\administrators_authorized_keys`, which silently rejects connections unless inherited permissions are stripped (`icacls.exe ... /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"`).

---

## 4. Crypto-agility via a short-lived SSH Certificate Authority (CA)

Static `authorized_keys` files across 40 servers and 25 developer laptops turn every cryptographic advisory into weeks of manual key rotation and orphan-key cleanup (especially in universities where RAs and contractors rotate yearly).

Moving SSH authentication to a **short-lived SSH Certificate Authority** backed by institutional OIDC/SAML makes algorithm upgrades a **single-point CA change**:

```
┌──────────────────────────────────────────────────────────────────────┐
│                   STATIC AUTHORIZED_KEYS (BRITTLE)                   │
│  Laptop private key ──► copied to N servers' ~/.ssh/authorized_keys  │
│  Result: rotating algorithm or offboarding requires N host edits     │
└──────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────┐
│               SHORT-LIVED SSH CA + OIDC (CRYPTO-AGILE)               │
│                                                                      │
│  1. Developer authenticates via Campus SSO / OIDC (+ MFA)            │
│                      │                                               │
│                      ▼                                               │
│  2. SSH CA (Vault / step-ca / Teleport) mints 8-hour ephemeral cert  │
│     • principal = user@org   • signed with CA key (P-384 / ML-DSA)   │
│                      │                                               │
│                      ▼                                               │
│  3. Target Ubuntu/Windows servers trust ONLY `TrustedUserCAKeys`     │
│     (plus `HostCertificate` so clients never rely on TOFU alone)     │
└──────────────────────────────────────────────────────────────────────┘
```

In `/etc/ssh/sshd_config.d/99-pqc-hardening.conf`, add two lines:

```ssh-config
TrustedUserCAKeys /etc/ssh/ca_user.pub
CASignatureAlgorithms ssh-mldsa44-ed25519,ecdsa-sha2-nistp384,rsa-sha2-512
```

When OpenSSH 10.6+ and `ssh-mldsa44-ed25519` roll out across your server fleet, you rotate the **CA signing keypair** once — zero edits to individual user accounts on target machines, and leaked developer laptops lose access automatically after the 8-hour certificate expires.

---

## 5. Git infrastructure &amp; software supply-chain integrity

Git interacts with cryptography in three distinct places, each requiring its own remediation:

### 1. Transport (`git clone`, `fetch`, `push`)

- **GitHub:** Serves `sntrup761x25519-sha512` over `git@github.com` SSH automatically when the client supports it. Verify with `ssh -vv git@github.com`.
- **GitLab (Self-Managed / Dedicated):** Requires `gitlab-sshd` &gt;= 18.2.4 or host OpenSSH 9.9+ for PQ key exchange; older Omnibus builds trigger OpenSSH 10.1+ `WarnWeakCrypto` alerts on developer workstations.
- **Self-hosted Gitea / Forgejo / internal mirrors:** Built-in Go SSH daemons often lag OpenSSH PQ KEX. Either delegate SSH termination to host OpenSSH (`9.9+` / `10.2+`) or standardise CI/developer traffic over **HTTPS through a PQ TLS 1.3 proxy** (`X25519MLKEM768` via Caddy 2.10+ or Nginx + OpenSSL 3.5+).

### 2. CI/CD identity: kill deploy keys and long-lived PATs

Static RSA-2048 repository deploy keys and unexpiring Personal Access Tokens are the highest-value targets in Git estates. Replace them with **OIDC workload identity federation**:

- **GitHub Actions / GitLab CI -&gt; Cloud (AWS / Azure / GCP / Cloudflare):** Configure `id-token: write` and verify repository/branch claims (`sub`, `environment`) in IAM trust policies so zero long-lived private keys exist in repository secrets.
- **Cross-repo automation:** Use short-lived **GitHub App installation tokens** scoped to specific repositories rather than machine-user SSH keys or personal PATs.

### 3. Commit &amp; tag provenance (`ssh-keygen -Y`, Sigstore &amp; Git SHA-256)

Git 2.34+ supports signing commits and tags using standard SSH keys (`gpg.format ssh`). However, a critical nuance emerges under **post-AI / post-quantum threat models**: if an adversary can break a classical P-256/RSA signature key in 2031, how do you know a commit claiming to be from 2026 was genuinely signed *in 2026* before the key was broken?

- **Today's practical pairing:** Use `gpg.format ssh` with a hardware-backed FIDO2 or P-384 key, track active and historical keys in a versioned `allowed_signers` file (`valid-after` / `valid-before` timestamps supported by OpenSSH!), and for release tags/artefacts pair signatures with **Sigstore Rekor transparency-log timestamps** or RFC 3161 trusted timestamps so signature validity is anchored to creation time.
- **Git SHA-256 repositories (`git init --object-format=sha256`):** Git's SHA-256 object format addresses SHA-1 collision resistance rather than asymmetric RSA/ECC breaks, and ecosystem interoperability across forges, submodules and CI plugins remains incomplete in 2026. Keep SHA-1/SHA-256 migration plans separate from SSH/TLS post-quantum hardening.

---

## 6. Automated fleet &amp; CI verification harness

Run this read-only verification script from a modern OpenSSH 10.6+ runner or bastion to catch classical KEX fallbacks, undersized RSA host keys and stale deploy/user keys across servers and Git endpoints:

```bash
#!/usr/bin/env bash
set -euo pipefail

# Usage: ./verify-pqc-ssh.sh bastion.example.org git@github.com
TARGETS=("$@")
if [ "${#TARGETS[@]}" -eq 0 ]; then
  echo "Usage: $0 <ssh-target> [<ssh-target> ...]" >&2
  exit 2
fi

FAIL=0

for target in "${TARGETS[@]}"; do
  echo "=== Checking $target ==="
  out=$(ssh -vv -o BatchMode=yes -o ConnectTimeout=6 \
    -o StrictHostKeyChecking=accept-new \
    -o RequiredRSASize=3072 \
    -o WarnWeakCrypto=yes \
    "$target" true 2>&1 || true)

  kex=$(echo "$out" | grep -i "kex: algorithm:" | tail -n1 || true)
  echo "  KEX: ${kex:-unknown}"

  if ! echo "$kex" | grep -qE "mlkem768x25519|sntrup761x25519"; then
    echo "  FAIL: non-post-quantum KEX negotiated on $target"
    FAIL=1
  fi

  if echo "$out" | grep -qiE "WARNING:.*not using a post-quantum|RSA key.*too small"; then
    echo "  FAIL: weak crypto or undersized RSA host key detected on $target"
    FAIL=1
  fi
done

# Audit local or checked-in authorized_keys / allowed_signers for weak RSA or DSA
for keyfile in "${HOME}/.ssh/authorized_keys" ".config/git/allowed_signers"; do
  [ -f "$keyfile" ] || continue
  while IFS= read -r line; do
    [[ -z "$line" || "$line" == \#* ]] && continue
    bits=$(echo "$line" | ssh-keygen -lf - 2>/dev/null | awk '{print $1}' || echo "0")
    algo=$(echo "$line" | ssh-keygen -lf - 2>/dev/null | awk '{print $NF}' || echo "")
    if [[ "$algo" == "(DSA)" ]] || [[ "$algo" == "(RSA)" && "${bits:-0}" -lt 3072 ]]; then
      echo "  FAIL: weak key in $keyfile ($bits $algo)"
      FAIL=1
    fi
  done < "$keyfile"
done

exit "$FAIL"
```

Pair this note with [Crypto-Agility for Client Servers: Edge-to-Origin TLS, PKI, VPNs and Legacy Containment](https://gigantic.work/engineering/crypto-agility-for-client-servers-and-tls/) for web proxies, Campus Moodle/SSO, backups and legacy containment, or see our hands-on [Step-by-Step Guide &amp; Configurator](https://gigantic.work/tutorials/hardening-ssh-servers-and-git-for-post-quantum/).

---

Published by Gigantic Work, an IT vendor with a team in London and Hong Kong, building AI, learning platforms, web platforms, research portals, cloud and 3D/VR projects for universities, grant-funded projects, NGOs, schools and SMEs. Contact: info@gigantic.work · https://gigantic.work/contact/ · Site overview: https://gigantic.work/llms.txt
