Description of problem: Removing keys from ssh-agent does not work: [thomas@sarkovy .ssh]$ ls ca_key ca_key.pub host_key host_key.pub user_key user_key.pub [thomas@sarkovy .ssh]$ ssh-add -l 256 SHA256:WXrds3toVaf16i8gZs0lBroHuiSqX6MYXnQl2hogRis Host key (ED25519) 256 SHA256:Fq20YtHavHvF5pNhZC8a/ivpmkemeEFlxVjOlmFy6MI User key (ED25519) 256 SHA256:zxQ9IdMp7CJZ9MeR7e+HLdne/4WxfLkhOUJujotraT8 CA signing key (ED25519) [thomas@sarkovy .ssh]$ ssh-add -d user_key.pub Could not remove identity "user_key.pub": agent refused operation [thomas@sarkovy .ssh]$ ssh-add -l 256 SHA256:WXrds3toVaf16i8gZs0lBroHuiSqX6MYXnQl2hogRis Host key (ED25519) 256 SHA256:Fq20YtHavHvF5pNhZC8a/ivpmkemeEFlxVjOlmFy6MI User key (ED25519) 256 SHA256:zxQ9IdMp7CJZ9MeR7e+HLdne/4WxfLkhOUJujotraT8 CA signing key (ED25519) [thomas@sarkovy .ssh]$ ssh-add -D All identities removed. [thomas@sarkovy .ssh]$ ssh-add -l 256 SHA256:WXrds3toVaf16i8gZs0lBroHuiSqX6MYXnQl2hogRis Host key (ED25519) 256 SHA256:Fq20YtHavHvF5pNhZC8a/ivpmkemeEFlxVjOlmFy6MI User key (ED25519) 256 SHA256:zxQ9IdMp7CJZ9MeR7e+HLdne/4WxfLkhOUJujotraT8 CA signing key (ED25519) Version-Release number of selected component (if applicable): 8.8p1-7.fc37 How reproducible: always Steps to Reproduce: See above Actual results: Keys are not removed Expected results: Keys should be removed Additional info: It seems that creating a new key via ssh-keygen automatically adds it to ssh-agent. AFAICT this behavior is not mentioned anywhere in the man pages, and it exacerbates the problem.
You are not running ssh-agent, but gnome-keyring, which for convenince lists all the keys that you have in default location. ``` $ echo $SSH_AUTH_SOCK /run/user/1000/keyring/ssh ``` If the keys have passphrase and you do not have them stored somewhere (in the keyring), it will prompt for the passphrase the first time you use the key. This is documented in manual page for gnome-keyring-daemon: > The daemon also implements a GnuPG and SSH agent both of which automatically load the user's keys, and prompt for passwords when necessary. This is not a bug. Sorry it took too long to come back with the answer.