简体   繁体   English

SSH GITHUB 密钥

[英]SSH GITHUB Keys

I'm new to developing with GITHUB on a mac.我是在 Mac 上使用 GITHUB 开发的新手。 I have created the SSH public and private key files and have the public key in the settings on git hub.我已经创建了 SSH 公钥和私钥文件,并且在 git hub 的设置中有公钥。 I moved the files to the ~/.ssh folder on my mac.我将文件移动到我的 mac 上的 ~/.ssh 文件夹。

The issue is that when I try to push to the remote branch, I get an access denied.问题是,当我尝试推送到远程分支时,访问被拒绝。

Jims-MacBook-Pro-2:romannumeralconverterAPI jrieck$ git push --set-upstream origin master
Enter passphrase for key '/Users/jrieck/.ssh/id_rsa': 
Enter passphrase for key '/Users/jrieck/.ssh/id_rsa': 
ERROR: Permission to jrieckPillarTechnology/ArabicToRomanNumeralAPI.git denied to deploy key
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.
Jims-MacBook-Pro-2:romannumeralconverterAPI jrieck$ 

Any thoughts on the reason for the access denied error?关于拒绝访问错误的原因有什么想法吗?

It sounds like you've set up your key as a deploy key, which are by default read-only.听起来您已将密钥设置为部署密钥,默认情况下为只读。 The idea behind a deploy key is that you can have an automated system use that key to access a specific repository for the purpose of deploying it to production.部署密钥背后的想法是,您可以让自动化系统使用该密钥访问特定存储库,以便将其部署到生产环境中。 You can read more about why deploy keys are useful in the GitHub documentation .您可以在GitHub 文档 中阅读有关为什么部署密钥有用的更多信息。

If you're going to be using this key with your account as a human, not for an automated process, you probably want to remove it as a deploy key and instead add it as a key for your account, as described in the GitHub documentation for adding an SSH key .如果您打算将此密钥与您的帐户一起使用,而不是用于自动化流程,您可能希望将其作为部署密钥删除,而是将其添加为您的帐户的密钥,如GitHub 文档中所述用于添加 SSH 密钥 Note that you'll need to remove the key as a deploy key first;请注意,您需要先将密钥作为部署密钥删除; if you don't, you won't be able to add it as a key for your account.如果不这样做,您将无法将其添加为帐户的密钥。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM