ssh-agent无法记住密码


0
ssh me@server
eval $(ssh-agent);
set | grep SSH_A
 SSH_AGENT_PID=19216
 SSH_AUTH_SOCK=/tmp/ssh-CYiyq19215/agent.19215
ssh-add
 Enter passphrase for /home/me/.ssh/id_rsa: 
 Identity added: /home/me/.ssh/id_rsa (/home/me/.ssh/id_rsa)
ssh-add -l
 2048 8f:bf:61:e5:f2:bc:bc:c2:57:9e:03:8e:d1:b3:28:93 /home/me/.ssh/id_rsa (RSA)
ssh x@other server
 Enter passphrase for key '/home/me/.ssh/id_rsa': 

我原以为我的密码 id_rsa 文件已保存,因此我不需要再次重新输入。

它适用于该服务器上的不同用户,但我看不出有什么不同。任何线索?

Answers:


0

看来,如果你没有公钥,你会得到这种行为。

请注意,它要求输入密码,但如果按下它也可以。 (如果输入错误的密码,虽然不行)

一旦我将相应的公钥复制到服务器,我就不再需要密码了

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.