简体   繁体   English

如何使用我的 github 配置文件 SSH 密钥来修改我的所有存储库?

[英]How can I use my github profile SSH key to modify all my repos?

I've inserted a SSH key in my github profile, and then I tried to push some changes, but I received the error: Permission denied (public key).我在我的 github 配置文件中插入了一个 SSH 密钥,然后我尝试推送一些更改,但我收到错误:权限被拒绝(公钥)。 I tried the solutions of the GitHub Docs, but it didn't work for me, I even tried this:我尝试了 GitHub 文档的解决方案,但它对我不起作用,我什至尝试了这个:

eval "$(ssh-agent -s)" && ssh-add ~/.ssh/directorytokey eval "$(ssh-agent -s)" && ssh-add ~/.ssh/directorytokey

How can I modify my repos with SSH if I have a SSH key set in my GitHub Profile?如果我的 GitHub 配置文件中设置了 SSH 密钥,如何使用 SSH 修改我的存储库?

As commented, the GitHub documentation does illustrate adding the private SSH key (not its parent folder) to ssh-agent正如所评论的, GitHub 文档确实说明了将私有SSH 密钥(不是其父文件夹)添加到 ssh-agent

# start the ssh-agent in the background
$ eval `ssh-agent -s`
> Agent pid 59566
$ ssh-add ~/.ssh/id_ed25519

That being said, you can:话虽如此,您可以:

  • start with a private key which is not passphrase protected first, for testing从一个没有密码保护的私钥开始,用于测试

  • check if the key is properly detected/used with检查密钥是否被正确检测/使用

     ssh -Tv git@github.com # or, for a custom key filename: ssh -Tv -i /path/to/my/private_key git@github.com

You should see a welcome message ('Hi, ...')您应该会看到一条欢迎消息(“嗨,...”)

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

相关问题 如何在 Github 中查看我的公共和私有 SSH 密钥? - How can I view my public and private SSH key in Github? 如何查看github的SSH密钥? - How can I review my SSH key for github? 如何使用SSH将存储库推送到GitHub? - How can I use SSH to push my repository to GitHub? 使用 ssh 在我的 GitHub 组织中查看存储库 - View repos in my GitHub organisation using ssh 如何使用git repos作为PyPi包的依赖项? - How can I use git repos as dependencies for my PyPi package? 如何在个人资料页面上显示的“常用存储库”存储库中添加更多标签? - How can I add more tags on the 'popular repositories' repos, which are displayed on my profile page? 我如何为 github 设置到我的计算机的 ssh? - How can i set up the ssh to my computer for github? 我怎样才能将我的API密钥/凭证推送到Github,尤其是Public Repos - How can I not push my API Keys/Credentials to Github, especially Public Repos 如何使用 GitHub 上的项目创建一个组,并将前端和后端关联为该组(项目)的存储库? - How can I create a group with my project on GitHub and the FrontEnd and BackEnd associated to be repos of this group(project)? 我可以使用 GIT Bash 一次在我的所有 repos 上检查一个特定的分支吗? - Can I use GIT Bash to checkout a particular branch on all my repos at once?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM