Capistrano 部署 ** 主机密钥验证失败
我遵循了其他网站的一些建议,但没有效果。当我尝试时 cap 部署:冷
我始终收到“主机密钥验证失败”的信息。
我已经尝试了一切。我已经从我的计算机 ssh 到远程,从已知主机中删除并读取了两个密钥,从 github 克隆,从服务器和 github 上的本地设置了我的公钥。
我在这里缺少什么?
上限文件: https://gist.github.com/1308243
I've followed several suggestions from other sites but to no avail. When I trycap deploy:cold
I consistently get "Host key verification failed."
I've tried everything. I've ssh'd from my computer to the remote, removed and readded both keys from known-hosts, cloned from github, set up my public key from both the server and local on github.
What am I missing here?
Capfile:
https://gist.github.com/1308243
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
添加到您的deploy.rb:
或者登录到您要部署到的服务器(作为您的部署用户)并运行:
大多数时候我看到这个问题是当 github.com 不在您的
中时~ /.ssh/known_hosts
Add to your deploy.rb:
Or log in to the server(s) you are deploying to (as your deploy user) and run:
Most of the time I see this issue is when github.com in not in your
~/.ssh/known_hosts
而不是使用看起来像这样的 git ssh url
[email protected]:definelabs/urbanairship.git
使用只读 url看起来像这样
git://github.com/definelabs/urbanairship.git
Instead of using a git ssh url which looks like this
[email protected]:definelabs/urbanairship.git
use a read only url which looks like this
git://github.com/definelabs/urbanairship.git
您曾提到
cap deploy:setup
有效,但cap deploy
失败。所以看起来错误消息与 ssh 连接无关,而与 git checkout 有关。这可能是因为您的 git 远程服务器使用基于密钥的身份验证,并且服务器中缺少所需的密钥。You had mentioned that
cap deploy:setup
worked andcap deploy
failed. So looks like the error message is not related to the ssh connectivity, and its related to git checkout. It might be because that your git remote server works with key based authentication and the required key is missing in the server.除此之外,
我还需要执行这个,如下:
尽管如此,应该注意的是 Capistrano 不鼓励 PTY:
https://github.com/capistrano/capistrano#a-word-about- ptys
In addition to
I also needed do this, with below:
Although, it should be noted that PTY's are discouraged by capistrano:
https://github.com/capistrano/capistrano#a-word-about-ptys
一个与服务器上的
~/YOUR_USER_NAME /.ssh/authorized_keys2
相关的文件。我相信它应该包含公钥/私钥(两者之一,我认为是私钥?)One file to get concerned with
~/YOUR_USER_NAME /.ssh/authorized_keys2
on the server. I believe it should contain the public/private key (one of the two, I think private?)