我已经为此苦苦挣扎了几个小时,因此非常感谢任何帮助......
我有 2 个服务器,我可以ssh
使用来自 OSX 的公钥来连接这两个服务器,那里根本没有问题,所以我确定sshd_config
.
我正在尝试配置一个 cron 作业rsync
来同步两台服务器,并需要ssh
使用公钥将服务器 B(备份)连接到服务器 A。
我一生都无法弄清楚为什么它找不到我的公钥 - 它们在~/.ssh/
(即/root/.ssh
)中,并且 A 和 B 上的所有文件权限都是正确的。
这是输出:
debug2: we did not send a packet, disable method
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug3: no such identity: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_rsa
debug3: no such identity: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa …
Run Code Online (Sandbox Code Playgroud)