swa*_*nee 2 git ssh capistrano bitbucket
我正在尝试使用Capistrano设置自动部署配置,但是当Capistrano尝试运行命令时我一直都会遇到故障
git ls-remote -h git@bitbucket.org:vendor/repo.git
Run Code Online (Sandbox Code Playgroud)
该用户的SSH密钥在Bitbucket中正确设置,因为我可以git clone git@bitbucket.org:vendor/repo.git在该服务器内部没有问题.
我还在ls-remote我的常规开发机器中测试了临时服务器外部的命令,我每天都在使用Git工作,我发现它在Bitbucket上也不起作用(我的开发机器中的SSH密钥显然已经设置好了) .
实际输出是:
git ls-remote -h ssh://git@bitbucket.org/vendor/repo.git
ssh: connect to host bitbucket.org port 22: Operation timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)
虽然我可以在那些相同的目录上做到push并且pull没有任何问题.
ls-remoteBitbucket 上的命令怎么了?除常规配置外,我是否应该进行一些额外配置才能使其正常工作?
正如解释在这里,我不得不这样做是我的私人密钥添加到认证代理.首先,启动身份验证代理:
$ eval `ssh-agent -s`
Run Code Online (Sandbox Code Playgroud)
列出可用的键:
$ ssh-add -l
The agent has no identities.
Run Code Online (Sandbox Code Playgroud)
要添加新密钥:
$ ssh-add ~/.ssh/identity
Run Code Online (Sandbox Code Playgroud)
identity例如,私钥文件在哪里id_rsa.从现在开始,git ls-remote命令开始正常工作.
| 归档时间: |
|
| 查看次数: |
4001 次 |
| 最近记录: |