简体   繁体   English

尽管 SSH 身份验证有效,但 Git 的权限被拒绝

[英]Permission denied to Git despite valid SSH authentication

This morning my Windows git client surprised me with今天早上我的 Windows git 客户让我感到惊讶

> git pull

git@github.xxx.net: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

This happens despite the fact SSH authentication with GitHub works尽管使用 GitHub 的 SSH 身份验证有效,但仍会发生这种情况

>ssh git@github.xxx.net
PTY allocation request failed on channel 0
Hi dzieciou! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.xxx.net closed.

Would could be the reason?可能是原因吗? I have all necessary permission to access this particular project.我拥有访问这个特定项目的所有必要权限。

First, check what the same git pull does after typying首先,检查输入后相同的git pull做了什么

set GIT_SSH_COMMAND="ssh -Tv"

And compare it with ssh -Tv git@github.xxx.net并将其与ssh -Tv git@github.xxx.net进行比较

Second, make sure there is no other GIT environment variable.其次,确保没有其他GIT环境变量。 To list them:列出它们:

set GIT

This is to check if there is a GIT_SSH environment variable, referencing a different ssh as the one you would be using by default with Git for Windows.这是为了检查是否存在GIT_SSH环境变量,引用不同的 ssh 作为默认情况下您将与 Git 一起用于 Windows 的环境变量。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM