[英]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参考
https://superuser.com/questions/232373/how-to-tell-git-which-private-key-to-use https://superuser.com/questions/232373/how-to-tell-git-which-private-key-to-use
https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-你的 ssh 密钥到 ssh 代理
https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-key/ https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-key/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.