使用ssh密钥从Vagrant框转发到远程服务器



试图让一些capistrano部署脚本从Windows上的Vagrant Ubuntu VM工作到远程Ubuntu服务器,试图访问github失败:

Running /usr/bin/env git ls-remote -h git@github.com:company/repo.git on x.y.z.a
DEBUG[28ec78e1]         Error reading response length from authentication socket.
DEBUG[28ec78e1]         Permission denied (publickey).
  1. ssh -T git@github.com在虚拟机中运行正常:(hello you, ....消息显示)
  2. git在远程机器上正确设置:(可以做一个pull w/username + password,因为我不想在forward上留下我的key)
  3. 我相信脚本是健康的(其他用户可以成功地按原样运行部署脚本)
  4. 我已经试过了,在流浪文件中打开ssh-agent-forwarding和不打开ssh-agent-forwarding都不行。

还有什么需要调整的?

这是一个意想不到的解决方案,所以我将把它发布给其他有神秘部署问题的人:

  • 本地git已经使用https url设置
  • 远程git已经使用公钥设置。
  • 部署似乎首先使用本地git验证其密钥。

混合口味似乎有一些问题;使用git ssh-clone url在本地机器上进行干净的签出,问题就消失了。

这应该是一个更改,但两个本地存储库的源代码差异显示没有更改。奇怪。

最新更新