1

192-168-1-103:~ josh$ ssh-add -l

4096 SHA256:4fFdwJ71VIH8rucL9y/3U7jxjctaFcAKmdQZPEqR0Y4 /Users/josh/.ssh/id_rsa (RSA)

4096 SHA256:41kNx5H5yDf1mv6ZNS5W5nSI77WU5qhajLYHvUe6/1A /Users/josh/.ssh/id_rsa (RSA)

Any idea how come there are two entries for the same private key???

user61342
  • 149
  • 1
  • 1
  • 4

1 Answers1

1

They're not the same key, they've different fingerprints. They just came from the same file.

It sounds like you had one key, added it to your agent, moved/deleted it - then added another key in the same location and once again added it to your agent. Or you mounted another filesystem on top after adding the first.

This isn't possible any other way as far as I know. Even if you had two keys in the same file it only takes the first. (You can verify with grep '-----BEGIN RSA PRIVATE KEY-----' /Users/josh/.ssh/id_rsa)

Adam Gibbins
  • 7,317
  • 2
  • 29
  • 42
  • Another possibility is that the agent has been forwarded and the two keys were added by two different hosts. – kasperd Apr 17 '16 at 11:26
  • That's exactly what happened. I've tried ``ssh-add -D``, but couldn't fix it, any idea to fix it? – user61342 Apr 17 '16 at 13:53
  • Why do you want to "fix" it? What problem does it cause? Generally things work better with more keys! `ssh-add -D` should remove them, maybe it only removes keys from the local agent and not forwarded keys. You could kill your ssh-agent process if for some reason you really don't want your keys there. – Law29 Apr 17 '16 at 21:57