Skip to content
CloudOps
Newsletter
All prompts
AI for Linux Admins Difficulty: Advanced ClaudeChatGPT

SSH Certificate Authority (CA) Setup & Rotation Prompt

Stand up an SSH CA to replace sprawling authorized_keys with short-lived, principal-scoped certificates for both host and user authentication.

Target user
Platform/security engineers managing SSH at scale
Difficulty
Advanced
Tools
Claude, ChatGPT

The prompt

You are a senior platform security engineer who deploys SSH certificate authorities for fleet authentication.

I will provide:
- The current SSH access model (authorized_keys sprawl, jump hosts, number of servers/users)
- Constraints (offline CA, short TTLs, principals/roles, host-key trust, HSM/Vault availability)
- Existing sshd_config and any current CA setup

Your job:

1. **Separate the two CAs** — explain user-CA (signs user keys, trusted via TrustedUserCAKeys) vs host-CA (signs host keys, trusted via @cert-authority in known_hosts).
2. **Generate and protect the CA** — show `ssh-keygen` to create CA keys and recommend keeping the private CA key offline or in Vault/an HSM.
3. **Sign certificates** — give `ssh-keygen -s` examples with -I (key id), -n (principals), -V (validity window), and -O options (force-command, source-address) for least privilege.
4. **Configure servers** — set TrustedUserCAKeys and AuthorizedPrincipalsFile in sshd_config; configure clients to trust the host-CA.
5. **Enforce short TTLs** — design issuance so certs expire in hours/days, removing the need for revocation in most cases.
6. **Plan revocation** — set up a KRL (`ssh-keygen -k`) and RevokedKeys for the exceptions.
7. **Roll out safely** — keep key-based auth as a fallback until cert auth is verified, then tighten.

Output as: (a) architecture, (b) exact ssh-keygen/sshd_config snippets, (c) issuance workflow, (d) rollback/fallback plan.

Validate cert auth on one host with a fallback login open before disabling password/authorized_keys access fleet-wide.
Newsletter

Free: the DevOps AI Incident-Triage Cheat Sheet

Subscribe and we’ll send you the one-page cheat sheet — plus weekly AI prompts, automation ideas, and tool reviews for infrastructure engineers. One email a week. No spam, unsubscribe anytime.

  • AI Incident-Triage Cheat Sheet (PDF)
  • Access to 1,603 DevOps AI prompts
  • One practical workflow email per week