I have GPG set up to talk to SSH (with --enable-ssh-support
). I have two keys: say 0x1234
and 0xABCD
. Both keys have the following subkeys:
- a signing key
- an encryption key
- an authentication key
Therefore, I have two different public keys when I run ssh-add -L
with 0x1234
first followed by 0xABCD
(I think this order is defined by whichever key was last added). It all works nicely.
I need two different keys because I have some servers that accept only one of the two keys. However, I also have servers that accept both keys (Github, for example). I would prefer to use 0xABCD
over 0x1234
even though both will be accepted. However, SSH will always choose the first accepted key, so 0x1234
is preferred over 0xABCD
all the time in such servers.
I imagine this has to be changed in the GPG side of things because it's gpg-agent
that's returning the keys in this order.
Is there any way I can force the order of keys reported?