简体   繁体   English

git命令授权失败后ssh授权成功连接git@github.com

[英]git commands fail to authorize after ssh authorization succeed to connect to git@github.com

I have created a private git repo on github.我在 github 上创建了一个私有 git 存储库。 I ran the commands ssh-keygen -t ed25519 -C "me@gmail.com" -f ".\id_ed22519_me" and ssh-add.\id_ed22519_me to create the private and public keys, and added the public ssh key to github.我运行命令ssh-keygen -t ed25519 -C "me@gmail.com" -f ".\id_ed22519_me"ssh-add.\id_ed22519_me来创建私钥和公钥,并将公共 ssh 密钥添加到 ZBF215181B51405B5414736 I also have setup the following config to use the correct keys:我还设置了以下配置以使用正确的键:

#~/.ssh/config
Host github.com-me
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_ed22519_me
  IdentitiesOnly yes

However when I try to use the git command I get the following error:但是,当我尝试使用 git 命令时,出现以下错误:

#powershell
PS C:\Path\to\Project> ssh -T git@github.com
   Hi me! You've successfully authenticated, but GitHub does not provide shell access.

PS C:\Path\to\Project> git push --set-upstream origin master
   git@github.com: Permission denied (publickey).
   fatal: Could not read from remote repository.

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

Can anyone know what could lead to that?谁能知道会导致什么? I also have made sure that I use the correct url for the remote "origin", and that my branch is indeed "master"我还确保我对远程“原点”使用正确的 url,并且我的分支确实是“主”

https://gist.github.com/jexchan/2351996#gistcomment-522294 This appears to resolve my issue. https://gist.github.com/jexchan/2351996#gistcomment-522294这似乎解决了我的问题。 I'm a bit weirded out that I have to append my username to the URL, but it works ^^我有点奇怪,我必须将我的用户名 append 到 URL,但它有效 ^^

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

相关问题 通过 ssh 的远程命令失败,即使 ssh -T git@github.com 成功 - Remote commands via ssh fail, even though ssh -T git@github.com is successful Git 在 windows 上克隆:git@github.com 不是 ZBA9F11ECC3497BD6993B933E50Z 命令 - Git clone on windows : git@github.com is not a git command 为什么 git@github.com:Windows 中的权限被拒绝(公钥)? - Why git@github.com: Permission denied (publickey) in windows? Git 子模块:git@github.com:权限被拒绝(公钥)。 致命:无法从远程存储库中读取 - Git submodule: git@github.com: Permission denied (publickey). fatal: Could not read from remote repository Git在Windows上使用ssh连接 - Git connect using ssh on windows GitHub / 私有存储库 / SSH:go get/go mod tidy fail,而 ZBA9F11ECC3497D999Z5 克隆正在工作 - GitHub / private repository / SSH: go get/go mod tidy fail, while git clone is working Git 配置上 windows 用于 ssh 访问 ZE1ADBCBB92C622D0B3E619F9D0703 - Git configuration on windows for ssh access to Github git ssh 无法访问主机但使用直接 IP 时成功(Windows 10) - git ssh fails to access host but succeed when direct IP is used (Windows 10) 如何在Windows上以SSH详细模式运行git命令? - How can I run git commands on Windows with SSH verbose mode? 无法获取git扩展以将某些内容推送到github SSH问题 - Cannot get git extensions to push something to github SSH problems
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM