Bitbucket / Github:权限被拒绝公钥 [英] Bitbucket/Github: permission denied public key

查看:905
本文介绍了Bitbucket / Github:权限被拒绝公钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 权限

当我试图克隆Rails应用程序回购库时,我已经获得了许可。被拒绝(publickey)。
致命:无法从远程存储库读取。

请确保您拥有正确的访问权限
并存在存储库。

即使通过生成一个公钥添加公钥,我无法解决这个问题。



尽管我可以使用 https 方法进行克隆,但在进行更改后,我尝试推送代码时出现同样的错误。



请为此建议一个答案。 首先, cd 放入您的 .ssh 目录中。打开终端并运行:

  cd〜/ .ssh&& ssh-keygen 

第二,您需要将其复制到剪贴板:

  cat id_rsa.pub | pbcopy#在OSX上
cat id_rsa.pub | xclip#在Linux上

第三,将您新生成的ssh密钥添加到您的帐户通过github / bitbucket网站(只需粘贴)。



下一步,设置您的git config:

  git config --global user.name'your_user_name'
git config --global user.email'your_email'

最后,重新启动您的命令行以确保重新加载配置。



现在,您应该能够克隆并从/到您的github存储库。



有关这个,看这个 github页面或这个 bitbucket页面


when I am trying to clone a rails app repo I have got permission to, I am getting this issue.

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Even after adding public key by generating one, I am unable to solve this.

Although I am able to clone using he https method but after making changes, the same error comes while I try to push the code.

Please suggest an answer for this.

解决方案

First, cd into your .ssh directory. Open up the terminal and run:

cd ~/.ssh && ssh-keygen

Second, you need to copy this to your clipboard:

 cat id_rsa.pub | pbcopy # On OSX
 cat id_rsa.pub | xclip # On Linux

Third, add your newly generated ssh key to your account via the github/bitbucket website (just paste there).

Next, setup your git config:

git config --global user.name 'your_user_name'
git config --global user.email 'your_email'

Finally, restart your command line to make sure the config is reloaded.

Now, you should be able to clone and push from/to your github repository.

For more information on this, see this github page or this bitbucket page.

这篇关于Bitbucket / Github:权限被拒绝公钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆