Somewhat related - but for a new hobby project where I needed to provision a VM (bringing up with opentofu and cloud init for the ssh access, pyinfra for rest of config, as a cloud init changes triggers teardown and rebuild of the vm) - finally got around to using ssh ca certificates.
This is partly due to LLMs making the ca setup easier. Ssh certs won't magically safeguard your keys, but: eliminate tofu (trust on first use) for server. Mutual trust rooted in CA; client can trust server, server can trust client.
And of course use a client cert tuned to server and session duration - a cert with a 12h validity won't be misused after it expires.
I suppose nest step is to ensconce the ca key in a handful of USB tokens.
Time poor mans solution - use an SSH port other than 22
Somewhat related - but for a new hobby project where I needed to provision a VM (bringing up with opentofu and cloud init for the ssh access, pyinfra for rest of config, as a cloud init changes triggers teardown and rebuild of the vm) - finally got around to using ssh ca certificates.
This is partly due to LLMs making the ca setup easier. Ssh certs won't magically safeguard your keys, but: eliminate tofu (trust on first use) for server. Mutual trust rooted in CA; client can trust server, server can trust client.
And of course use a client cert tuned to server and session duration - a cert with a 12h validity won't be misused after it expires.
I suppose nest step is to ensconce the ca key in a handful of USB tokens.