错误致命:无法从远程存储库中读取。 ``$ ssh -add -l -e sha256`代理没有身份。
通过笔记本电脑上的Vscode连接我的github,我有一个问题。我还读过其他相关问题a>和 this 没有运气(我从头开始创建了一个新密钥)。我已经遵循与ssh 多次成功(以防万一生成新密钥)。我的问题是当我试图推动时。我遵循说明在这里。一切正常工作,直到$ ssh -add -l -e sha256
我收到的错误消息是代理没有身份。
可能是因为我已连接到另一个不同GitHub帐户之前(我有两个)?我创建了一个新键,因此从理论上讲,它们应该与众不同。
I have an issue connecting my github through VScode on my laptop. I have read other relevant questions like this and this with no luck (I created a new key from scratch). I have followed all steps for connecting to github with SSH succesfuly multiple times (generated new keys just in case). My problem is when I am trying to push. I followed instructions here. Everything works fine up until $ ssh-add -l -E sha256
The error message I get is The agent has no identities.
Could it be because I was connected to a different github account previously (I have two)?I created a new key so in theory they should be different.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些方向有些误导。他们告诉您要验证您的密钥在代理中,而不告诉您如何首先将其添加到代理商中。 (实际上,他们这样做了,但是在单独的页面。)您需要运行一个命令
ssh-add〜/.ssh/my_key
首先要填充代理。 (每次您启动新代理时,都需要重复此操作;用于自动填充用钥匙链中的键的代理的技术超出了此答案的范围。)我不为代理而烦恼。相反,我将类似以下内容添加到我的SSH配置文件中。
然后,
ssh
而不是需要查找IdentityFile
指定的文件,而不是需要查找活动代理。(如果将密码添加到密钥中,则代理很方便,因为在将密钥添加到代理中时,您只会提示您的密码,而不是每次
ssh
尝试使用键。)The directions are somewhat misleading. They tell you to verify that your key is in the agent without telling you how to add it to the agent in the first place. (Actually, they do, but on a separate page.) You need to run a command like
ssh-add ~/.ssh/my_key
first to populate the agent. (This needs to be repeated every time you start a new agent; techniques for automatically populating an agent with keys stored in a keychain are beyond the scope of this answer.)I don't bother with an agent. Instead, I add something like the following to my SSH configuration file.
Then, instead of needing to look in an active agent,
ssh
simply looks for the file specified byIdentityFile
.(If you add a passphrase to your key, the agent is convenient because you will only be prompted for the passphrase when you add the key to the agent, not every time
ssh
tries to use the key.)