Capistrano 无法通过 git 进行身份验证
Capistrano fails authenticate with git
在尝试使用 capistrano 部署网站时,我收到以下消息:
INFO ---------------------------------------------------------------------------
INFO START 2016-10-19 21:56:37 +0200 cap staging deploy
INFO ---------------------------------------------------------------------------
INFO [95790a6d] Running /usr/bin/env mkdir -p /tmp as mysite@staging.mysite.com
DEBUG [95790a6d] Command: /usr/bin/env mkdir -p /tmp
INFO [95790a6d] Finished in 0.407 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/git-ssh-mysite-staging-username.sh 0.0%
INFO Uploading /tmp/git-ssh-mysite-staging-username.sh 100.0%
INFO [0cd82d0b] Running /usr/bin/env chmod 700 /tmp/git-ssh-mysite-staging-username.sh as mysite@staging.mysite.com
DEBUG [0cd82d0b] Command: /usr/bin/env chmod 700 /tmp/git-ssh-mysite-staging-username.sh
INFO [0cd82d0b] Finished in 0.029 seconds with exit status 0 (successful).
INFO [0265a2c7] Running /usr/bin/env git ls-remote --heads git@bitbucket.org:username/mysite.git as mysite@staging.mysite.com
DEBUG [0265a2c7] Command: ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-mysite-staging-username.sh" ; /usr/bin/env git ls-remote --heads git@bitbucket.org:username/mysite.git )
DEBUG [0265a2c7] conq: repository access denied.
DEBUG [0265a2c7] fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
然而,当我手动 运行 这个命令时,作为同一个用户,一切正常:
$ export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-mysite-staging-username.sh" ; /usr/bin/env git ls-remote --heads git@bitbucket.org:username/mysite.git
928c1e393778f25869f14958151c4ea1dc7d68b6 refs/heads/master
我已验证我的 public 密钥是存储库的 bitbucket 部署密钥。这以前工作得很好。有什么办法可以进一步调试吗?
我找到了解决方案 。显然 ssh-agent
需要 运行.
在尝试使用 capistrano 部署网站时,我收到以下消息:
INFO ---------------------------------------------------------------------------
INFO START 2016-10-19 21:56:37 +0200 cap staging deploy
INFO ---------------------------------------------------------------------------
INFO [95790a6d] Running /usr/bin/env mkdir -p /tmp as mysite@staging.mysite.com
DEBUG [95790a6d] Command: /usr/bin/env mkdir -p /tmp
INFO [95790a6d] Finished in 0.407 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/git-ssh-mysite-staging-username.sh 0.0%
INFO Uploading /tmp/git-ssh-mysite-staging-username.sh 100.0%
INFO [0cd82d0b] Running /usr/bin/env chmod 700 /tmp/git-ssh-mysite-staging-username.sh as mysite@staging.mysite.com
DEBUG [0cd82d0b] Command: /usr/bin/env chmod 700 /tmp/git-ssh-mysite-staging-username.sh
INFO [0cd82d0b] Finished in 0.029 seconds with exit status 0 (successful).
INFO [0265a2c7] Running /usr/bin/env git ls-remote --heads git@bitbucket.org:username/mysite.git as mysite@staging.mysite.com
DEBUG [0265a2c7] Command: ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-mysite-staging-username.sh" ; /usr/bin/env git ls-remote --heads git@bitbucket.org:username/mysite.git )
DEBUG [0265a2c7] conq: repository access denied.
DEBUG [0265a2c7] fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
然而,当我手动 运行 这个命令时,作为同一个用户,一切正常:
$ export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-mysite-staging-username.sh" ; /usr/bin/env git ls-remote --heads git@bitbucket.org:username/mysite.git
928c1e393778f25869f14958151c4ea1dc7d68b6 refs/heads/master
我已验证我的 public 密钥是存储库的 bitbucket 部署密钥。这以前工作得很好。有什么办法可以进一步调试吗?
我找到了解决方案 ssh-agent
需要 运行.