我已经为此苦苦挣扎了两个小时,因此我们将不胜感激。
我有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
debug3: no such identity: /root/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
还请注意,它正在寻找不存在的私钥...
drwx------. 2 root root 4096 May 25 10:15 .
dr-xr-x---. 4 root root 4096 May 24 18:52 ..
-rw-------. 1 root root 403 May 25 01:37 authorized_keys
-rw-------. 1 root root 0 May 25 01:41 config
-rw-------. 1 root root 1675 May 25 02:35 id_rsa_tm1
-rw-------. 1 root root 405 May 25 02:35 id_rsa_tm1.pub
-rw-------. 1 root root 395 May 25 02:36 known_hosts
_tm1
从您的密钥文件名(即mv id_rsa_tm1 id_rsa
和mv id_rsa_tm1.pub id_rsa.pub
)
ls -la /root/.ssh/