17

How come this happens?:

stan@tcpc:~/.ssh$ ssh-add -l
8192 e0:45:5e:cc:45:3e:17:2b:a6:54:6f:8d:53:1b:j2:e3 github (RSA)
2048 25:41:53:a6:45:5d:ac:eb:5c:45:f8:ce:42:a9:he:aa BITBUCKET (RSA)
stan@tcpc:~/.ssh$ ssh-add -D
All identities removed.
stan@tcpc:~/.ssh$ ssh-add -l
8192 e0:45:5e:cc:45:3e:17:2b:a6:54:6f:8d:53:1b:j2:e3 github (RSA)
2048 25:41:53:a6:45:5d:ac:eb:5c:45:f8:ce:42:a9:he:aa BITBUCKET (RSA)

How come keys aren't being erased?

p.s. could be this bug? http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472477 I'm on arch linux though...

3
  • That bug is years old; on an up-to-date Arch box, it works as expected: openssh 6.2p1-1
    – jasonwryan
    Commented Apr 16, 2013 at 18:16
  • jsonwryan... it's actual not years old. Last comment dated 05 Oct 2012 - mentions that it still wasn't fixed. Other comments suggest that the problem is upstream. And no - it doesn't work for me on up-to-date Arch system. However - when I move ssh keys from ~/.ssh directory into ~/.ssh/my_keys (as suggested in bug report) -> addition and removal does work as expected. Commented Apr 16, 2013 at 18:25
  • 3
    Read the report carefully: "Fixed in version 3.2.2-2" - pacman -Ss gnome-keyring: 3.6.3-1
    – jasonwryan
    Commented Apr 16, 2013 at 18:32

3 Answers 3

3

The steps in this post worked for me; you just need to open the Startup Applications manager, uncheck the entry for "SSH Key Agent - GNOME Keyring: SSH Agent", and restart Unity. If it doesn't show up, edit /etc/xdg/autostart/gnome-keyring-ssh.desktop and change NoDisplay=true to NoDisplay=false.

2
  • 2
    the link to "this post" is dead
    – Carson Ip
    Commented Aug 23, 2018 at 4:12
  • Why would showing the gnome keyring tool make a difference in removing the keys? Commented Oct 29, 2021 at 16:53
3

Go to /tmp folder, delete all folder starts with ssh

solomon@debian:/tmp$ rm -rf ssh

solomon@debian:/tmp$ ssh-add -D

All identities removed.

solomon@debian:/tmp$ ssh-add -l
The agent has no identities.
1
  • Don't know why this was down voted. It put me in the right track, although I wouldn't remove ssh folder (!!!!). By just changing folder name and then back to .ssh, gnome keyring stopped listing ssh key. That allowed me to do ssh-add and it all was working as it should
    – cortopy
    Commented May 15, 2016 at 16:36
1

I had the same problem as you did. I'm not an expert, but the solution that worked for me was to remove the keys from the ~/.ssh directory. This is an example of what I was seeing.

$ ssh-add -l
2048 06:e9:a6:14:2a:e4:c3:11:56:ea:c3:5d:f9:84:79:c6 first key (RSA)
2048 2c:c3:97:fe:f3:cf:03:dc:d3:0b:87:2b:01:72:33:3b second key (RSA)
$ ssh-add -d ~/.ssh/id_rsa.pub
Identity removed: /home/user/.ssh/ybot_rsa.pub (/home/user/.ssh/id_rsa.pub)
$ ssh-add -l
2048 06:e9:a6:14:2a:e4:c3:11:56:ea:c3:5d:f9:84:79:c6 first key (RSA)
2048 2c:c3:97:fe:f3:cf:03:dc:d3:0b:87:2b:01:72:33:3b second key (RSA)

It was after moving id_rsa (and id_rsa.pub) from the ~/.ssh folder that the ssh-agent stopped having the identity. What I did was:

$ ssh-add -l
2048 06:e9:a6:14:2a:e4:c3:11:56:ea:c3:5d:f9:84:79:c6 first key (RSA)
2048 2c:c3:97:fe:f3:cf:03:dc:d3:0b:87:2b:01:72:33:3b second key (RSA)
$ mv ~/.ssh/id_rsa ~/.ssh/id_rsa.pub ~/
$ ssh-add -l
2048 2c:c3:97:fe:f3:cf:03:dc:d3:0b:87:2b:01:72:33:3b second key (RSA)

I'm guessing (I could be wrong) that if you didn't have the Gnome Keyring daemon running (gnome-keyring-daemon), this behaviour would change. Maybe the original (and logical) solution would work, but not the second one.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .