SSH Server Authentication with Certificates
Create a CA
Do it NOT no server!!
Configure the SSH Server to Trust the CA
Copy the CA to the server:
Add the required line to /etc/ssh/sshd_config and restart sshd service:
echo "TrustedUserCAKeys /etc/ssh/ca.pub" | sudo tee -a /etc/ssh/sshd_config
sudo systemctl restart sshd
Generate a User Key Pair
Sign the User's Public Key with the CA
This creates ./id_user-cert.pub.
-I : certificate identity (label)
-n : Principals — comma-separated list of allowed usernames
-V : Validity period (`+52w` = 1 year)
-z : Serial number
Connect to server
Additional actions
Verify the Certificate
Revoking a Certificate
Add to /etc/ssh/sshd_config: