总是被要求输入密码

总是被要求输入密码

我已经使用以下方式设置了 RSA 密钥对

如何设置 SSH 以便不需要输入密码?

但我一直被提示输入密码

输入密钥“/var/www/.ssh/id_rsa”的密码:

它从不保存密码吗?

答案1

ssh-keygen 将要求您输入密码。此时,只需按 Enter 键。再次按 Enter 键确认空密码。如果您在此处不指定密码,则登录时不会要求您输入密码。

# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa): [just press ENTER here to save in the default location]
Enter passphrase (empty for no passphrase):                   [just press ENTER here to save your key without a passphrase]
Enter same passphrase again:                                  [just press ENTER here to confirm the empty passphrase]
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
53:4d:b5:72:46:c1:b8:cd:72:82:3e:7a:08:f5:31:e3 user@host
The key's randomart image is:
+--[ RSA 2048]----+
|            .++. |
|           o.... |
|          ..o++  |
|        ..= +++  |
|       .S+ + +   |
|      .  .E      |
|       . o .     |
|        o .      |
|         .       |
+-----------------+

相关内容