Linux
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)?
是的問題
您可以為 rsync 指定其他遠端 shell,而不是使用 ssh
-e
,其中包括帶有額外選項的 ssh,因此添加-e "ssh -o StrictHostKeyChecking=no"
會起作用。