I have several keys registered:
$ ssh-add -l
4096 cd:43:96:9e:0c:9a:38:ae:d9:96:f0:c5:d1:bf:9d:96 alex@sunny2 (RSA)
2048 4c:eb:fc:6b:ab:a0:ff:99:c3:ff:13:0a:95:2a:68:70 ███████ (RSA)
4096 01:cc:8d:c9:3c:ca:cf:39:93:57:e5:36:91:30:c2:94 ██████(RSA)
4096 87:b3:05:9a:68:6a:2b:be:1f:6f:ce:1b:34:50:c9:01 ██████████(RSA)
2048 37:d7:c6:08:65:9e:d4:8e:57:a2:05:36:71:e3:0b:13 ███ (RSA)
2048 3c:62:aa:4e:86:6d:83:b0:f7:b8:fb:0a:db:c4:67:3b ██████ (RSA)
1024 a4:1b:cb:c9:a0:99:19:80:67:e2:1b:14:5b:7e:17:cf ███████ (RSA)
I tried ssh-add -d
██████ to remove selectively,
and ssh-add -D
to remove all keys.
this does not seem to work. After I executed ssh-add -D
, the output of ssh-add -l
is the same like before.
I tried, for example, ssh-add -d alex@sunny2
, and also the full path to the key file, which is, in this example, ~/.ssh/alex_rsa
.
I also tried 'wildcard-remove', ssh-add -d ~/.ssh/*
.
Interestingly I get a confirmation, that the key was removed:
Identity removed: .ssh/alex_rsa ( alex@sunny2)
But ssh-add -l
afterwards again lists all the key files, so it seems there went something wrong while removing. Or, there is some mechanism which adds the keys immediately again.
$ cat ~/.ssh/config
Host *
ServerAliveInterval 240
Host 192.168.0.107
PreferredAuthentications keyboard-interactive,password,publickey,hostbased,gssapi-with-mic
Host github.com
HostName github.com
IdentityFile ~/.ssh/alex_rsa
SSH version is:
$ ssh -V
OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8, OpenSSL 1.0.1f 6 Jan 2014