简体   繁体   English

"无法从工作笔记本电脑访问个人 github"

[英]cannot access personal github from work laptop

I have generated an SSH key on my work laptop ( ssh-keygen -t ed25519 -C "me@my-personal-email.org" ) and added it to the list of SSH keys of my personal repository.我在我的工作笔记本电脑上生成了一个 SSH 密钥( ssh-keygen -t ed25519 -C "me@my-personal-email.org" )并将其添加到我的个人存储库的 SSH 密钥列表中。 Yet when I try to git push to this personal repo (from my work laptop) I get the message:然而,当我尝试git push到这个个人仓库时(从我的工作笔记本电脑),我得到了这样的信息:

ERROR: Repository not found.
fatal: Could not read from remote repository.

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

I also added these lines to the repo .git/config :我还将这些行添加到 repo .git/config

[user]
    name = MY NAME
    email = me@my-personal-email.org

... and I get the same error. ...我得到同样的错误。

The repo definitely exists and I thought I had set up access... what could I be missing?回购肯定存在,我以为我已经设置了访问权限......我会错过什么?

Check if you have done the step to add the SSH key to the SSH agent:检查您是否已完成将 SSH 密钥添加到 SSH 代理的步骤:

# start the ssh-agent in the background
$ eval "$(ssh-agent -s)"
> Agent pid 59566

and, then接着

$ ssh-add ~/.ssh/id_ed25519

Essentially, you need to inform git which private key you will be using for the git connection.本质上,您需要告知git您将使用哪个私钥进行git连接。

Host One
    HostName ssh.github.com
    IdentityFile ~/.ssh/id_rsa
    User git

Host Two
    HostName ssh.<enterprise>.github.com
    IdentityFile ~/.ssh/id_rsa
    User git

References参考

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

相关问题 无法从 travis 发布到 github 包注册表:尽管包含 github 个人访问令牌,但 401 未经授权 - Cannot publish to github package registry from travis: 401 unauthorized despite including github personal access token 如何从 github 提交个人访问令牌 - How to commit Personal Access token from github 无法将我的 github 个人访问令牌更新到 watson studio - Cannot update my github personal access token to watson studio github 使用个人访问令牌的自动身份验证不起作用 - github auto authentication with personal access tokens doesn't work 无法让个人访问令牌与 github 一起用于自己的回购 - Can't get personal access tokens to work with github for own repo 如何从工作 Github 帐户切换到个人帐户? - How to switch from work Github account to Personal one? 有没有一种方法可以在不使用个人访问令牌的情况下从脚本向 github 进行身份验证? - Is there a way to authenticate to github from a script without using a personal access token? 如何将个人访问令牌与来自 GitHub 的 HTTPS url 一起使用? - How to use personal access token with HTTPS urls from GitHub? 使用个人访问令牌推送到 Github 不起作用 - Pushing to Github using Personal Access Token not working 个人访问令牌仅用于修改存储库GITHUB - Personal access token only to modify repositories GITHUB
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM