我正在尝试将我的Rails应用程序从Bitbucket部署到Digital。我使用Git作为我的版本控制系统,我做了以下工作:
pbcopy < ~/.ssh/id_rsa.pubhttps://bitbucket.org/<account name>/<project admin/deploy-keys)但是,当我运行cap deploy时,它会出现以下错误
servers: [<server ip>]
[<server ip>] executing command
** [<server ip> :: out] Permission denied (publickey).
** [<server ip> :: out]
** [<server ip> :: out] fatal: Could not read from remote repository.
** [<server ip> :: out]
** [<server ip> :: out]
** [<server ip> :: out] Please make sure you have the correct access rights
** [<server ip> :: out]
** [<server ip> :: out] and the repository exists.
** [<server ip> :: out]这是我的deploy.rb文件
set :scm, "git"
set :repository, "git@bitbucket.org:<user name>/<project name>.git"
set :branch, "master"如果我clone回购到我的本地,它的工作很好。我查看了Bitbucket文档,但仍然找不出丢失了什么。
我的ssh to Bitbucket起作用了:
ssh -T git@bitbucket.org
authenticated via a deploy key.
You can use git or hg to connect to Bitbucket. Shell access is disabled.
This deploy key has read access to the following repositories:
<repor name>找到了这个SO question但没有任何运气。
发布于 2014-08-11 14:12:38
好的,我找到了解决方案,我会把它加到这里,这样可能有人会发现它有用。
我修复了在Digital中创建SSH键并将其添加到Bitbucket中的问题。
以下是以下步骤
https://bitbucket.org/<user>/<project>/admin/deploy-keys)中发布于 2020-02-21 07:41:40
如果要向已经有一些密钥的液滴中添加额外的SSH密钥,则需要在SSH上启用密码身份验证才能完成此任务。通过控制面板添加SSH键只能在创建过程中添加到液滴中。
如果您无法使用现有的SSH密钥访问机器,则需要使用web控制台为您的液滴执行以下步骤。若要启用密码身份验证,请按照以下步骤操作。
使用您最喜欢的文本编辑器编辑此配置文件。
/etc/ssh/sshd_config
找到"PasswordAuthentication no“的行,并将其更改为"PasswordAuthentication是”,然后保存并退出编辑器。
返回命令提示符后,运行以下命令以允许进行新的SSH更改。
/etc/init.d/ssh重新启动
一旦SSH重新启动,您可以尝试SSH‘can您的水滴。如果您获得的权限被拒绝错误,您可能需要更新您的密码使用"passwd“命令。
当您通过计算机上的SSH成功登录到您的服务器时,我建议您按照下面文章中的步骤获得为此液滴配置的新SSH密钥。
https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2
我希望这个信息是有用的!请让我们知道,如果您有任何问题或遇到任何问题的过程中!
https://stackoverflow.com/questions/25245075
复制相似问题