更改私钥上的ssh密码不起作用

我有一个不受密码 ssh密钥保护 ,我用它来连接服务器。 现在我想添encryption钥到密钥,所以我做了:

ssh-keygen -p 

并添加了一个新的密码:

 Enter file in which the key is (/home/user/.ssh/id_rsa): Enter old passphrase: Key has comment '/home/user/.ssh/id_rsa' Enter new passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved with the new passphrase. 

然后,我尝试再次连接到服务器:

 ssh [email protected] -v 

但我仍然没有input密码login:

debug1:可以继续的身份validation:publickey

debug1:下一个validation方法:publickey

debug1:提供RSA公钥:/home/user/.ssh/id_rsa

debug1:服务器接受密钥:pkalg ssh-rsa blen 279

debug1:authentication成功(publickey)。

通过server.comauthentication([xxx.xx.xxx.xx]:22)。

为什么我不要求密码?

编辑:

海马为我储存钥匙,所以这是问题。

ssh-agent在内存中存储encryption的密钥,所以更改为磁盘上的物理密钥不会影响其function。

如果要确保更改有效,请从代理中删除密钥,并按照注释中所述再次添encryption钥( ssh-add -D删除, ssh-add从默认位置再次添encryption钥)。