简体   繁体   中英

Permission denied to Git despite valid SSH authentication

This morning my Windows git client surprised me with

> 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

>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

set GIT_SSH_COMMAND="ssh -Tv"

And compare it with ssh -Tv git@github.xxx.net

Second, make sure there is no other GIT environment variable. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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