Also a good time to consider migrating to using SSH certificates so you never have to play the authorized keys dance ever again. :)
Its not that difficult.
Which reminds me to check my certificates, actually.
Sure there are managed ways to do it, like `AuthorizedKeysCommand` or Ansible etc.
But for most people, especially those people allowing manual management of keys files, there are more cons than benefits of authorized keys.
I assume and hope it's as simple as setting up one key and then automatically being able to log in with any subsequently signed key.
Yes, in the most basic implementation that's it.
Obviously RTFM, but the gist is that the CA SSH Key gets defined on the server (sshd_config) side, e.g :
TrustedUserCAKeys /etc/ssh/user_ca.pub
AuthorizedPrincipalsFile /etc/ssh/principals
# AuthorizedKeysFile none # only once you're happy everything works ;)
And then yes, you can automagically log in with whatever is signed with the key(s) in `TrustedUserCAKeys` (as long as the principal defined in the signature matches one listed in `AuthorizedPrincipalsFile` – although IIRC you can wildcard `AuthorizedPrincipalsFile` so you might not even need to worry about that if you want a super-simple setup).Then once you're happy with the basic principles and tested it out, you can do more fancy stuff like using Yubikeys as a poor-man's HSM (hardware CA) and eventually all sorts of server-side (man sshd_config) magic.
Its great ! Welcome to the dark side. ;)
In practice, your client side devices may well be at more risk of loss due to theft or similar than your server is of being broken into, and it's pretty convenient to just scp your public keys over to sign them. I can reach my own CA private keys by SSH, just not via public IP address.
Here's a good resource for anyone wanting to get started with SSH certs: https://free-pmx.org/guides/ssh-certs/
The CA could be on a remote server. It could also be a folder of certs and keys on your laptop, and you manage it with the openssl CLI.