We're converting our ssh host keys to certificate-signed keys. I wanted to write a script that would use ssh-keyscan to grab all the public keys, then sign them all, and then use ansible to push the signed keys back out to all the systems. I do want a passphrase on my CA key that I use to sign host keys.
So I thought I'd be clever and fire up ssh-agent at the beginning of the script, use ssh-add to add the CA key to ssh-agent, and then run off a bunch of ssh-keygen -s commands without it prompting for the passphrase. The ssh-agent seems to start successfully, the ssh-add works, but the ssh-keygen does not seem to be using ssh-agent to get the CA key for signing. Is this a missing feature in ssh-keygen? I don't want to waste time debugging this script if ssh-keygen simply doesn't do this.
At this point, yes, I know I could strip the passphrase, do the work once, and then put the passphrase back. But in the future we may well want to bulk-add more hosts again, and it would be nice to both have a passphrase, and have a script that will bulk sign.
I'm open to alternate approaches but I'd also like a definitive answer about whether or not ssh-keygen is supposed to do this. I've searched and haven't found this info anywhere.