Ssh 提示在克隆存储库期间中断capistrano脚本

Ssh 提示在克隆存储库期间中断capistrano脚本,ssh,mercurial,capistrano,bitbucket,Ssh,Mercurial,Capistrano,Bitbucket,我使用capistrano进行部署,使用bitbucket托管我的mercurial存储库deploy.rb脚本工作正常,但问题是,我第一次从bitbucket克隆时,它会抛出此异常,并显示yes/no continue(是/否继续),这当然会影响自动化过程 情况就是这样: running ssh hg@bitbucket.org "hg -R vireton-dev/forecasts serve --stdio" The authenticity of host 'bitbucket.org

我使用capistrano进行部署,使用bitbucket托管我的mercurial存储库deploy.rb脚本工作正常,但问题是,我第一次从bitbucket克隆时,它会抛出此异常,并显示yes/no continue(是/否继续),这当然会影响自动化过程

情况就是这样:

running ssh hg@bitbucket.org "hg -R vireton-dev/forecasts serve --stdio"
The authenticity of host 'bitbucket.org (207.223.240.181)' can't be established.
RSA key fingerprint is 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40.
Are you sure you want to continue connecting (yes/no)?
我在脚本中使用以下行:

default_run_options[:pty] = true
ssh_options[:forward_agent] = true
set :scm_verbose, true
我做错什么了吗?我怎样才能摆脱那个提示


谢谢你的帮助

如果尚未接受主机的RSA指纹,则会发生此错误。如果您以部署用户身份ssh到服务器并运行

ssh hg@bitbucket.org

它会提示您接受RSA指纹。一旦这样做,服务器将把指纹保存在.ssh/known_hosts文件中,以后不再提示。这将使您未来的部署获得成功。从上面的代码到bitbucket的SSH连接将失败,但这将解决问题,因为我们不需要登录到远程主机来接受RSA密钥。

我不想登录服务器来解决这个问题。为了解决这个问题,我将信任bitbucket的已知主机加载到服务器,自动过程不会出现提示,但感觉像是黑客入侵,有没有其他方法?