[英]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.