我是一个初学者,Rails,Git和Capistrano试图部署我的第一个应用程序。
我已经安装了一个VPS,安装了Ubuntu、Nginx和Unicorn,现在需要使用Capistrano进行部署。我的应用程序存储在Bitbucket存储库中。
为了检查是否正确设置了Capistrano,我运行了以下命令。
$ cap production git:check和$ cap production deploy:check
然而,这些错误给了我以下错误:
INFO [c65cf8c7] Running /usr/bin/env mkdir -p /tmp/testapp/ as developer@[IP]
DEBUG [c65cf8c7] Command: /usr/bin/env mkdir -p /tmp/testapp/
Text will be echoed in the clear. Please install the HighLine or Termios libraries to suppress echoed text.
developer@[IP]'s password: [password]
INFO [c65cf8c7] Finished in 31.340 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/testapp/git-ssh.sh 0.0%
INFO Uploading /tmp/testapp/git-ssh.sh 100.0%
INFO [2dbfc686] Running /usr/bin/env chmod +x /tmp/testapp/git-ssh.sh as developer@[IP]
DEBUG [2dbfc686] Command: /usr/bin/env chmod +x /tmp/testapp/git-ssh.sh
INFO [2dbfc686] Finished in 0.017 seconds with exit status 0 (successful).
INFO [b0c6add8] Running /usr/bin/env git ls-remote --heads git@bitbucket.org:[USER]/testapp.git as developer@[IP]
DEBUG [b0c6add8] Command: ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/testapp/git-ssh.sh" ; /usr/bin/env git ls-remote --heads git@bitbucket.org:[USER]/testapp.git )
DEBUG [b0c6add8] Warning: Permanently added 'bitbucket.org,104.192.143.3' (RSA) to the list of known hosts.
DEBUG [b0c6add8] Error reading response length from authentication socket.
DEBUG [b0c6add8] Permission denied (publickey).
DEBUG [b0c6add8] fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as developer@[IP]: git exit status: 128
git stdout: Nothing written
git stderr: Warning: Permanently added 'bitbucket.org,104.192.143.3' (RSA) to the list of known hosts.
Error reading response length from authentication socket.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
SSHKit::Command::Failed: git exit status: 128
git stdout: Nothing written
git stderr: Warning: Permanently added 'bitbucket.org,104.192.143.3' (RSA) to the list of known hosts.
Error reading response length from authentication socket.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Tasks: TOP => git:check
(See full trace by running task with --trace)对于我的git存储库来说,SSH认证、标准git命令(如push或pull )似乎出了问题。
Grom我的本地机器$ ssh -T git@bitbucket.com告诉我:
Warning: Permanently added the RSA host key for IP address '104.192.143.7' to the list of known hosts.
logged in as [USER].
You can use git or hg to connect to Bitbucket. Shell access is disabled.从我的developer@vps帐户:ssh -T git@bitbucket.com
Warning: Permanently added the RSA host key for IP address '104.192.143.7' to the list of known hosts.
Permission denied (publickey).有什么想法吗?
发布于 2016-03-05 04:34:34
Capistrano试图在部署目标(即VPS )上签出git存储库。因此,您需要从VPS机器获得到bitbucket的ssh连接。
我想您的ssh标识在本地主机和VPS上是不同的,并且您只在bitbucket中配置了本地机器ssh密钥。
您能比较一下本地机器上的~/.ssh/id_rsa.pub和VPS作为developer登录时的情况吗?如果密钥不同,则需要将VPS中的公共ssh密钥( id_rsa.pub文件)添加到bitbucket配置中,以便可以使用ssh从VPS连接到bitbucket。
https://stackoverflow.com/questions/35807957
复制相似问题