$ -weight: 600;">sudo -weight: 500;">install -d -m 0700 /etc/ssh/ca
-weight: 600;">sudo ssh-keygen -t ed25519 -f /etc/ssh/ca/user_ca -C "ssh-user-ca-2026-03" -N ""
-weight: 600;">sudo chmod 600 /etc/ssh/ca/user_ca
-weight: 600;">sudo chmod 644 /etc/ssh/ca/user_ca.pub
-weight: 600;">sudo -weight: 500;">install -d -m 0700 /etc/ssh/ca
-weight: 600;">sudo ssh-keygen -t ed25519 -f /etc/ssh/ca/user_ca -C "ssh-user-ca-2026-03" -N ""
-weight: 600;">sudo chmod 600 /etc/ssh/ca/user_ca
-weight: 600;">sudo chmod 644 /etc/ssh/ca/user_ca.pub
-weight: 600;">sudo -weight: 500;">install -d -m 0700 /etc/ssh/ca
-weight: 600;">sudo ssh-keygen -t ed25519 -f /etc/ssh/ca/user_ca -C "ssh-user-ca-2026-03" -N ""
-weight: 600;">sudo chmod 600 /etc/ssh/ca/user_ca
-weight: 600;">sudo chmod 644 /etc/ssh/ca/user_ca.pub
-weight: 600;">sudo -weight: 500;">install -d -m 0755 /etc/ssh/auth_principals
-weight: 600;">sudo -weight: 500;">install -m 0644 /path/to/user_ca.pub /etc/ssh/trusted_user_ca_keys.pub # Map Linux user "deploy" to allowed cert principals
printf 'deploy\nops\n' | -weight: 600;">sudo tee /etc/ssh/auth_principals/deploy >/dev/null
-weight: 600;">sudo chmod 0644 /etc/ssh/auth_principals/deploy
-weight: 600;">sudo -weight: 500;">install -d -m 0755 /etc/ssh/auth_principals
-weight: 600;">sudo -weight: 500;">install -m 0644 /path/to/user_ca.pub /etc/ssh/trusted_user_ca_keys.pub # Map Linux user "deploy" to allowed cert principals
printf 'deploy\nops\n' | -weight: 600;">sudo tee /etc/ssh/auth_principals/deploy >/dev/null
-weight: 600;">sudo chmod 0644 /etc/ssh/auth_principals/deploy
-weight: 600;">sudo -weight: 500;">install -d -m 0755 /etc/ssh/auth_principals
-weight: 600;">sudo -weight: 500;">install -m 0644 /path/to/user_ca.pub /etc/ssh/trusted_user_ca_keys.pub # Map Linux user "deploy" to allowed cert principals
printf 'deploy\nops\n' | -weight: 600;">sudo tee /etc/ssh/auth_principals/deploy >/dev/null
-weight: 600;">sudo chmod 0644 /etc/ssh/auth_principals/deploy
PubkeyAuthentication yes
TrustedUserCAKeys /etc/ssh/trusted_user_ca_keys.pub
AuthorizedPrincipalsFile /etc/ssh/auth_principals/%u
PasswordAuthentication no
PubkeyAuthentication yes
TrustedUserCAKeys /etc/ssh/trusted_user_ca_keys.pub
AuthorizedPrincipalsFile /etc/ssh/auth_principals/%u
PasswordAuthentication no
PubkeyAuthentication yes
TrustedUserCAKeys /etc/ssh/trusted_user_ca_keys.pub
AuthorizedPrincipalsFile /etc/ssh/auth_principals/%u
PasswordAuthentication no
-weight: 600;">sudo sshd -t
-weight: 600;">sudo -weight: 500;">systemctl reload ssh
# On some distros: -weight: 600;">sudo -weight: 500;">systemctl reload sshd
-weight: 600;">sudo sshd -t
-weight: 600;">sudo -weight: 500;">systemctl reload ssh
# On some distros: -weight: 600;">sudo -weight: 500;">systemctl reload sshd
-weight: 600;">sudo sshd -t
-weight: 600;">sudo -weight: 500;">systemctl reload ssh
# On some distros: -weight: 600;">sudo -weight: 500;">systemctl reload sshd
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -C "[email protected]" -N ""
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -C "[email protected]" -N ""
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -C "[email protected]" -N ""
ssh-keygen \ -s /etc/ssh/ca/user_ca \ -I "ali-ticket-4821" \ -n deploy,ops \ -V +8h \ -z 1001 \ ~/.ssh/id_ed25519.pub
ssh-keygen \ -s /etc/ssh/ca/user_ca \ -I "ali-ticket-4821" \ -n deploy,ops \ -V +8h \ -z 1001 \ ~/.ssh/id_ed25519.pub
ssh-keygen \ -s /etc/ssh/ca/user_ca \ -I "ali-ticket-4821" \ -n deploy,ops \ -V +8h \ -z 1001 \ ~/.ssh/id_ed25519.pub
ssh-keygen -L -f ~/.ssh/id_ed25519-cert.pub
ssh-keygen -L -f ~/.ssh/id_ed25519-cert.pub
ssh-keygen -L -f ~/.ssh/id_ed25519-cert.pub
Host prod-web-01 HostName 203.0.113.10 User deploy IdentityFile ~/.ssh/id_ed25519 CertificateFile ~/.ssh/id_ed25519-cert.pub IdentitiesOnly yes
Host prod-web-01 HostName 203.0.113.10 User deploy IdentityFile ~/.ssh/id_ed25519 CertificateFile ~/.ssh/id_ed25519-cert.pub IdentitiesOnly yes
Host prod-web-01 HostName 203.0.113.10 User deploy IdentityFile ~/.ssh/id_ed25519 CertificateFile ~/.ssh/id_ed25519-cert.pub IdentitiesOnly yes
ssh prod-web-01
ssh prod-web-01
ssh prod-web-01
-weight: 600;">sudo ssh-keygen -k -f /etc/ssh/revoked_keys.krl
-weight: 600;">sudo chmod 644 /etc/ssh/revoked_keys.krl
-weight: 600;">sudo ssh-keygen -k -f /etc/ssh/revoked_keys.krl
-weight: 600;">sudo chmod 644 /etc/ssh/revoked_keys.krl
-weight: 600;">sudo ssh-keygen -k -f /etc/ssh/revoked_keys.krl
-weight: 600;">sudo chmod 644 /etc/ssh/revoked_keys.krl
-weight: 600;">sudo ssh-keygen -k -u -f /etc/ssh/revoked_keys.krl ~/.ssh/id_ed25519-cert.pub
-weight: 600;">sudo ssh-keygen -k -u -f /etc/ssh/revoked_keys.krl ~/.ssh/id_ed25519-cert.pub
-weight: 600;">sudo ssh-keygen -k -u -f /etc/ssh/revoked_keys.krl ~/.ssh/id_ed25519-cert.pub
RevokedKeys /etc/ssh/revoked_keys.krl
RevokedKeys /etc/ssh/revoked_keys.krl
RevokedKeys /etc/ssh/revoked_keys.krl
-weight: 600;">sudo sshd -t
-weight: 600;">sudo -weight: 500;">systemctl reload ssh
-weight: 600;">sudo sshd -t
-weight: 600;">sudo -weight: 500;">systemctl reload ssh
-weight: 600;">sudo sshd -t
-weight: 600;">sudo -weight: 500;">systemctl reload ssh
ssh-keygen -Q -l -f /etc/ssh/revoked_keys.krl
ssh-keygen -Q -l -f /etc/ssh/revoked_keys.krl
ssh-keygen -Q -l -f /etc/ssh/revoked_keys.krl
-weight: 600;">sudo sshd -t
-weight: 600;">sudo sshd -t
-weight: 600;">sudo sshd -t
ssh-keygen -L -f ~/.ssh/id_ed25519-cert.pub
ssh-keygen -L -f ~/.ssh/id_ed25519-cert.pub
ssh-keygen -L -f ~/.ssh/id_ed25519-cert.pub
ssh -vvv deploy@server
ssh -vvv deploy@server
ssh -vvv deploy@server - keys copied everywhere
- stale access that never gets cleaned up
- painful offboarding
- no easy way to force short-lived access - trust one CA public key on servers,
- issue short-lived user certificates,
- control access with principals,
- revoke when needed. - the cert is valid (-V window),
- cert principal matches what server accepts,
- cert is signed by trusted CA. - CA host (secure admin machine): signs user keys
- Target server: trusts CA pubkey and enforces principals
- User laptop: has user key + signed cert - -s: CA private key used to sign
- -I: key identity string (audit-friendly)
- -n: certificate principals (who/roles this cert can act as)
- -V: validity period (+8h here)
- -z: serial number for tracking/revocation - CA key is offline or tightly restricted
- cert TTL: 4h–24h for humans, slightly longer for automation if needed
- principals represent roles (ops, db-admin, deploy) not people
- serials and -I identity map to ticket/change IDs
- KRL distributed to servers via config management - Check server config syntax: - Confirm cert details: - Verify principal is allowed for target user: cert principal appears in /etc/ssh/auth_principals/<user>
- cert principal appears in /etc/ssh/auth_principals/<user>
- Check validity window (Valid: field from ssh-keygen -L)
- Increase SSH client verbosity: - cert principal appears in /etc/ssh/auth_principals/<user> - Check server logs (journalctl -u ssh -u sshd -n 100) - OpenSSH ssh-keygen(1) manual (cert signing, validity, serials, KRL): https://man.openbsd.org/ssh-keygen.1
- OpenSSH sshd_config(5) manual (TrustedUserCAKeys, AuthorizedPrincipalsFile, RevokedKeys): https://man.openbsd.org/sshd_config
- Linux man-pages mirror for sshd_config(5) (distribution-friendly reference): https://man7.org/linux/man-pages/man5/sshd_config.5.html
- DEV API docs (publishing endpoint and payload shape): https://developers.forem.com/api