【发布时间】:2021-03-23 07:19:27
【问题描述】:
我在 github 上创建了一个私有 git repo。
我运行命令ssh-keygen -t ed25519 -C "me@gmail.com" -f ".\id_ed22519_me" 和ssh-add .\id_ed22519_me 来创建私钥和公钥,并将公共ssh 密钥添加到github。
我还设置了以下配置以使用正确的键:
#~/.ssh/config
Host github.com-me
HostName github.com
User git
IdentityFile ~/.ssh/id_ed22519_me
IdentitiesOnly yes
但是,当我尝试使用 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.
谁能知道是什么导致了这种情况?我还确保我为远程“原点”使用正确的 url,并且我的分支确实是“主”
【问题讨论】:
标签: windows git github ssh ssh-keys