1

I tried to set up an authentication subkey with GPG for authentication against SSH servers, following this instruction set. Everything seems to work so far, but ssh-add -l does not show any keys:

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

Also I cannot log in to servers where I put my public key.

What can I do to fix this?

quazgar
  • 881

1 Answers1

1

I found out that gpg-agent is picky about line endings in ~/.gnupg/sshcontrol. Specifically the line with the key ID needs to end with a newline, having the end of file there is not sufficient.

After adding a newline to the sshcontrol config file, ssh-add -l shows the key correctly.

quazgar
  • 881
  • Is this the solution to your post? Just wondering since this sounds like a comment to me, and you don't mention if this make ssh-add -l show the wanted output but I don't mind if i were to be wrong here :) – Nordine Lotfi May 15 '21 at 22:02
  • Thank you for your remark, @NordineLotfi, I amended the answer accordingly. – quazgar May 16 '21 at 12:36
  • 1
    Having a newline at the end is what makes it a line (and, by extension, the file a text file) by definition. – muru May 16 '21 at 12:45