简体   繁体   English

Capistrano使用错误的用户来获取远程回购。 权限被拒绝(公钥)

[英]Capistrano uses the wrong user to fetch remote repo. Permission denied (publickey)

I've configured the public key on BitBucket and it works from SSH, but using Capistrano it defaults to the wrong user: 我已经在BitBucket上配置了公钥,并且可以通过SSH使用,但是使用Capistrano时,它默认为错误的用户:

INFO [813163d1] Running /usr/bin/env git ls-remote --heads \
 git@bitbucket.org:phec06/my-repo.git as **fedorius@localhost**

While it should be using user ubuntu as specified in config/deploy/production.rb : 虽然它应该使用config/deploy/production.rb指定的用户ubuntu

server 'myserver.compute.amazonaws.com', user: 'ubuntu', roles: %w{app db web}

When I run: 当我跑步时:

cap production deploy

It gives me: 它给了我:

DEBUG [813163d1]    Permission denied (publickey).
DEBUG [813163d1]    fatal: Could not read from remote repository.

I've been searching for solutions to this all day and I'm new to Capistrano :( 我整天都在寻找解决方案,而我是Capistrano的新手:(

Using Capistrano 3.6.1 with Rails 5, deploying to AWS Ubuntu using a Mac OS X 结合使用Capistrano 3.6.1和Rails 5,使用Mac OS X部署到AWS Ubuntu

I think this is an issue on your bitbucket account or you are using wrong ssh-key for that account. 我认为这是您的Bitbucket帐户上的问题,或者您为该帐户使用了错误的ssh-key。 Please double check that you were logged in as **fedorius@localhost** . 请仔细检查您是否以**fedorius@localhost**登录。 Try belows 试试下面

eval `ssh-agent`
ssh-add ~/.ssh/id_rsa
ssh -T hg@bitbucket.org

Found the solution. 找到了解决方案。

Turns out I'm a little dumb. 原来我有点傻。 I started using capistrano-scm-gitcopy and gave up, but I left 我开始使用capistrano-scm-gitcopy并放弃了,但是我离开了

set :scm, :gitcopy

On my deploy.rb , removing this line solved the problem. 在我的deploy.rb ,删除此行解决了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Capistrano 和 GitHub Private Repo – 权限被拒绝(公钥) - Capistrano and GitHub Private Repo – Permission denied (publickey) Capistrano bitbucket - 权限被拒绝(publickey) - Capistrano bitbucket - Permission denied (publickey) 使用Capistrano部署Rails应用-权限被拒绝(公钥) - Deploying Rails app with Capistrano - Permission denied (publickey) Capistrano 在 git:check 上部署失败 - 权限被拒绝(公钥) - Capistrano Deploy Failing on git:check - Permission denied (publickey) 亚马逊EC2 + Capistrano + Git:权限被拒绝(publickey) - Amazon EC2 + Capistrano + Git: Permission denied (publickey) 权限被拒绝(公钥)。 严重的:无法从远程存储库读取 - Permission denied (publickey). fatal: Could not read from remote repository git remote push:权限被拒绝(publickey,键盘交互) - git remote push : Permission denied (publickey,keyboard-interactive) Capistrano rails 应用程序部署失败。 服务器无法向 Github 识别自我。 权限被拒绝(公钥) - Capistrano rails app deploying fails. Server can't identificate self to Github. Permission denied (publickey) Capistrano和Bitbucket权限被拒绝 - Capistrano and Bitbucket permission denied Capistrano 3权限被拒绝 - Capistrano 3 Permission Denied
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM