Host & client setup
Source:
docs/ssh/setup.md
Zones: if this installation uses SSH zones, every trust file below (User CA key,
@cert-authorityline, host cert, KRL) is per zone — a host trusts only its own zone’s user CAs. Fetch trust material from the zone-scoped endpoints (/ssh/zones/<zone>/…) or, for a single-zone install, the unchanged default-zone routes.
How to set up an SSH server and an SSH client by hand. For automated host setup, use the Ansible role instead — it performs the server steps below. Read the concept page first.
SSH server (host admin)
Section titled “SSH server (host admin)”Goal: the server presents its own host certificate and trusts user certificates signed by the User CA.
Prerequisites
Section titled “Prerequisites”- NTP/chrony running (certificate validity depends on the clock).
- The local accounts your principals map to (e.g.
root,deploy) already exist.
-
Generate the host key on the node (the private key never leaves it), and send only the public key to the operator. PKI Manager accepts only
ecdsa-sha2-nistp256host keys: the same key is the certificate subject and the recipient of the encrypted KRL (ECIES works only with P-256):Terminal window sudo ssh-keygen -t ecdsa -b 256 -f /etc/ssh/ssh_host_ecdsa_key -N "" -q # usually already presentcat /etc/ssh/ssh_host_ecdsa_key.pub # send THIS to the operator -
Get the deploy bundle from the operator (the host detail page → Files to place on this server). Place each file at the path shown. It contains:
File Path Mode Host certificate /etc/ssh/ssh_host_ecdsa_key-cert.pub0444User CA public key /etc/ssh/ssh-user-ca.pub0444sshd drop-in /etc/ssh/sshd_config.d/60-ssh-ca.conf0644AuthorizedPrincipals (per account) /etc/ssh/auth_principals/<account>0644The drop-in contains:
HostKey /etc/ssh/ssh_host_ecdsa_keyHostCertificate /etc/ssh/ssh_host_ecdsa_key-cert.pubTrustedUserCAKeys /etc/ssh/ssh-user-ca.pubAuthorizedPrincipalsFile /etc/ssh/auth_principals/%uRevokedKeys /etc/ssh/revoked_keysThe explicit
HostKeyline means sshd offers only this ECDSA key. Give clients the Host CA@cert-authorityline (below) before you reload, so they do not see a host-key prompt. -
Set up the KRL file.
RevokedKeysgates user logins, so the server serves the User CA’s KRL (revoked user certificates). The file must exist or sshd refuses every public-key login (sshd still starts, andsshd -tpasses). The bundle’s KRL snippet does this:Terminal window sudo install -m 0444 /dev/null /etc/ssh/revoked_keys# then refresh on a schedule (cron), replacing YOUR-PKI-HOST:*/15 * * * * root curl -fsS -o /etc/ssh/revoked_keys.new "https://YOUR-PKI-HOST/krl/<UserCaId>.bin" \&& install -m 0444 -o root -g root /etc/ssh/revoked_keys.new /etc/ssh/revoked_keys -
Validate and reload (reload, not restart — OpenSSH re-reads the cert, trust anchors, and KRL per authentication):
Terminal window sudo sshd -t && sudo systemctl reload ssh # unit is "ssh" on Debian/Ubuntu, "sshd" on RHEL
“Valid certificate but Permission denied”
Section titled ““Valid certificate but Permission denied””Almost always the principal-in-two-places rule: the principal in the user’s
cert is not in this host’s /etc/ssh/auth_principals/<account> for the account
they’re logging into. Re-check the mapping on the Principals page and that the
file was deployed.
SSH client (end user)
Section titled “SSH client (end user)”Goal: log in with a User CA-signed certificate instead of copying a public key
into authorized_keys.
-
Have a key (the certificate signs your existing public key):
Terminal window ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 # if you don't have onecat ~/.ssh/id_ed25519.pub # send ONLY this to the operator -
Save the certificate the operator returns next to your private key, with a matching base name and
-cert.pubsuffix —sshthen presents it automatically:Terminal window # paste into ~/.ssh/id_ed25519-cert.pubchmod 644 ~/.ssh/id_ed25519-cert.pub -
(Optional) add a
~/.ssh/configblock (scope theHostpattern to your fleet):Host *.example.comIdentityFile ~/.ssh/id_ed25519CertificateFile ~/.ssh/id_ed25519-cert.pubIdentitiesOnly yes -
Trust the servers’ Host CA so host-key warnings stop — add the Host CA
@cert-authorityline to~/.ssh/known_hosts(the operator provides it, orcurl https://YOUR-PKI-HOST/ssh/cert-authority?pattern=*.example.com). -
Verify and log in:
Terminal window ssh-keygen -L -f ~/.ssh/id_ed25519-cert.pub # check principals, validity, optionsssh <account>@server.example.com # account must map to one of your principals
When the certificate expires (~1 week), request a fresh one the same way — no new key needed.