8

I have two Arch Linux machines with virtually identical setup, both running /usr/bin/gnome-keyring-daemon --daemonize --login. They both have the same SSH secret key, but only one of them has the public key. On the host with the public key the GNOME Keyring daemon works fine - I can SSH to other machines without any prompts as expected. On the host without the public key it seems GNOME Keyring ignores that I've already entered the passphrase, and I'm prompted every time:

$ ls ~/.ssh/id_rsa.pub
ls: cannot access /home/user/.ssh/id_rsa.pub: No such file or directory
$ ssh some-host exit
Enter passphrase for key '/home/user/.ssh/id_rsa':
$ ssh other-host exit
Enter passphrase for key '/home/user/.ssh/id_rsa':

It also does not list the identity, even after entering the passphrase:

$ ssh-add -l
The agent has no identities.

After copying over the public key on a hunch I'm no longer prompted for a passphrase. After subsequently removing the public key again the symptom is back. Is there a reason for this behaviour, or is it simply a bug?

3

From the GNOME Keyring documentation SSH Agent page:

The SSH agent automatically loads files in ~/.ssh which have corresponding *.pub paired files. Additional SSH keys can be manually loaded and managed via the ssh-add command.

So GNOME Keyring will load id_rsa only if a corresponding id_rsa.pub exists.

You can generate one with ssh-keygen from the private key file

ssh-keygen -y -f id_rsa  > id_rsa.pub

If you don't want GNOME Keyring to load id_rsa automaticaly, you have to remove id_rsa.pub

I can't find any technical reasons for why this convention was chosen but it's not a bug.

  • Thanks for the reference. I'm not sure I agree it's not a bug, though. – l0b0 Jul 18 '16 at 20:45
  • fun fact, for 7 years this behavior was happening randomly to my co-workers. Today it happened to me and I finally stopped upon the doc page explaining everything. – hdorio Jul 18 '16 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.