rsync + rsync 失败,因为主机密钥验证失败

rsync + rsync 失败,因为主机密钥验证失败

我使用的是rsync为了将文件从/etc/yum.repos.d/远程服务器传输到/etc/yum.repos.d/

sshpass -p $password rsync -av /etc/yum.repos.d/* root@server_one.usaga.com:/etc/yum.repos.d
Host key verification failed.
rsync error: explained error (code 255) at rsync.c(551) [sender=3.0.9]

正如我们在上面看到的,rsync由于密钥指纹而失败

所以在我们做了以下操作之后(yes在 ssh 上回答)

ssh root@server_one.usaga.com
The authenticity of host 'server_one.usaga.com (43.3.22.4)' can't be established.
ECDSA key fingerprint is 08:b1:c7:fa:c3:a8:8f:ce:85:4f:b9:ac:b1:8a:6a:87.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'server_one.usaga.com,43.3.22.4' (ECDSA) to the list of known hosts.

并再次运行rsync- 它的作品

sshpass -p $password rsync -av /etc/yum.repos.d/* root@server_one.usaga.com:/etc/yum.repos.d
sending incremental file list
.
.
.

sent 378 bytes  received 112 bytes  326.67 bytes/sec
total size is 1937  speedup is 3.95

所以重新升级为rsync

rsync为了忽略,需要设置哪些标志key fingerprint

或者剂量rsync可以忽略有关的问题 - Are you sure you want to continue connecting (yes/no)?是的

答案1

您可以为 rsync 指定其他远程 shell,而不是使用 ssh -e,其中包括带有额外选项的 ssh,因此添加-e "ssh -o StrictHostKeyChecking=no"会起作用。

相关内容