Rails,Capistrano和Dreamhost - 密钥验证失败

时间:2012-03-01 02:53:06

标签: ruby-on-rails capistrano dreamhost ssh-keys

我正在尝试在Dreamhost上设置我的Rails应用程序,而我正处于尝试设置Capistrano的阶段。

我在与我部署的服务器相同的服务器上安装了git服务器。我有我的SSH密钥设置(我认为) - 至少我可以SSH没问题。

'cap deploy:setup'和'cap deploy:check'运行都没有错误。

但是当我尝试运行'cap deploy:migrations'时,我得到以下结果:

* executing `deploy:migrations'
* executing `deploy:update_code'
 updating the cached checkout on all servers
 executing locally: "git ls-remote user@server.dreamhost.com:git/project.git master"
 command finished in 1065ms
* executing "if [ -d /home/user/domain.com/shared/cached-copy ]; then cd /home/user/domain.com/shared/cached-copy && git fetch  origin && git fetch --tags  origin && git reset  --hard 406475489f2934554f5b80cf17e44576ba7ee02f && git clean  -d -x -f; else git clone user@domain.dreamhost.com:git/project.git /home/user/domain.com/shared/cached-copy && cd /home/user/domain.com/shared/cached-copy && git checkout -b deploy 406475489f2934554f5b80cf17e44576ba7ee02f; fi"
servers: ["server.dreamhost.com"]
[server.dreamhost.com] executing command
** [server.dreamhost.com :: out] Cloning into /home/user/domain.com/shared/cached-copy...

以下是问题所在:

** [server.dreamhost.com :: err] Host key verification failed.
** [server.dreamhost.com :: err] fatal: The remote end hung up unexpectedly
command finished in 157ms
failed: "sh -c 'if [ -d /home/user/domain.com/shared/cached-copy ]; then cd /home/user/domain.com/shared/cached-copy && git fetch  origin && git fetch --tags  origin && git reset  --hard 406475489f2934554f5b80cf17e44576ba7ee02f && git clean  -d -x -f; else git clone user@server.dreamhost.com:git/project.git /home/user/domain.com/shared/cached-copy && cd /home/user/domain.com/shared

我删除了我的密钥并创建了新密钥(再次,SSH进入服务器工作正常)无济于事。这对我来说可能是一个非常基本的误解,但我无法弄明白。

3 个答案:

答案 0 :(得分:0)

请删除dreamhost服务器上的 /home/user/.ssh/known_hosts ,然后重试。当从 user@server.dreamhost.com克隆时服务器正在访问自己:git / project.git

这台服务器的IP发生了变化,你会遇到这类问题。

答案 1 :(得分:0)

我有一个相同的设置&在部署的同一点上受到了阻碍。为了完成调查,我将添加以下详细信息:

Dreamhost服务器上的

(home / user / .ssh /):authorized_keys和id_rsa。

ssh user@server.dreamhost.com = no problem, but I was asked to verify key authenticity.

cap deploy:setup = no problems.
cap deploy:check = no problems.
cap deploy:migrations = failure (host key verification.)

答案 2 :(得分:0)

1)SSH进入Dreamhost

2)> ssh bitbucket.org

你会看到类似的东西:

The authenticity of host 'bitbucket.org (131.103.20.168)' 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)?

3)输入“是”

Warning: Permanently added 'bitbucket.org,131.103.20.168' (RSA) to the list of known hosts.

现在bitbucket.org已正确添加到.known_hosts