当我提示输入 RSA 密码时,无密码 SSH 无法从终端工作

rob*_*606 5 linux ssh rsa passphrase

我们已经设置了一个 CentOS 6.4 机器,通过无密码 SSH 连接到多个其他系统。当直接在 CentOS 计算机上使用终端作为正确的用户时,这可以正常工作。但是,如果我作为来自另一个系统的相同用户之一登录 CentOS 框,则会提示我输入 RSA 密钥密码。当我以正确的用户身份登录时,为什么需要这样做?

所以,如果我们有三台机器(A、B 和 C)。A 已设置为可以通过 SSH 无密码连接到机器 B。这很好用。但是,如果我们从机器 C SSH 到 A,然后从那个远程 SSH 终端尝试 SSH 到 B,这需要密码。

机器 A 上有访问其他几台机器的脚本(无密码)。我们需要能够从机器 C 远程登录到机器 A,然后启动访问机器 B 的脚本。

Dan*_*ore 0

如果您想避免这种情况,则需要生成不带密码的密钥并使用公钥身份验证。做类似的事情:

a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa): 
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A
Run Code Online (Sandbox Code Playgroud)

换句话说,只需在提示时按 Enter 键即可Enter passphrase (empty for no passphrase):

https://hkn.eecs.berkeley.edu/~dhsu/ssh_public_key_howto.html