我在尝试配置Capistrano 3.1以部署托管在Github上的应用程序时遇到了困难。
我正在遵循Capistrano文档,并已成功完成第一步(从工作站到服务器的SSH密钥)以及第二步(从我们的服务器到存储库主机),我能够成功运行ssh -A deploy@one-of-my-servers.com 'git ls-remote git@github.com:my_user/my_repo.git'
:
18f38afz261df35d462f7f4e2ca847d22f148a06 HEAD
18f38afz261df35d462f7f4e2ca847d22f148a06 refs/heads/master
然而,ssh deploy@one-of-my-servers.com 'git ls-remote git@github.com:my_user/my_repo.git'
失败了:
Permission denied (publickey).
Capistrano文档建议:
如果你收到“host key verification failed.”的错误,请登录服务器并以部署用户身份运行命令ssh git@github.com,以将github.com添加到已知主机列表中。
因此,我尝试了以上操作但是我得到了...
ssh git@github.com
Warning: Permanently added the RSA host key for IP address '192.30.252.131' to the list of known hosts.
Permission denied (publickey).
我基本上无法成功访问Github存储库。
SSH文档指出:
-A Enables forwarding of the authentication agent connection. This
can also be specified on a per-host basis in a configuration
file.
我如何在配置文件中按主机指定设置?我的本地机器运行Mac OSX Mavericks。VPS运行Ubuntu 12.04。
谢谢。
example.com
专门用于此类情况。因此,每当您需要一个示例域时,可以使用example.com
并确保您没有使用实际域,并遵循ICANN准则。ssh -A deploy@one-of-my-servers.com
- Stijn de Witt