How to configure multiple gpg authentication keys for different hosts similar to ~/.ssh/config

Viewed 23

I have 4 ssh-keys. I was using a gpg authentication key for most of my projects but for some I had to use different ssh keys. Those ssh keys were in ~/.ssh/ and configured in ~/.ssh/config based on hostnames.

Yesterday I had to use another gpg authentication key. I added keygrip in ~/.gnupg/sshcontrol.
I could see that key was loaded via running ssh-add -L

Connection got refused when I tried to connect. I changed the order of keys in /.gnupg/sshcontrol and it worked.

Is there config option in gpg or ssh so that I can offer gpg authentication keys based on hostnames?

Thanks

0 Answers
Related