簡體   English   中英

盡管 SSH 身份驗證有效,但 Git 的權限被拒絕

[英]Permission denied to Git despite valid SSH authentication

今天早上我的 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.

盡管使用 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.

可能是原因嗎? 我擁有訪問這個特定項目的所有必要權限。

首先,檢查輸入后相同的git pull做了什么

set GIT_SSH_COMMAND="ssh -Tv"

並將其與ssh -Tv git@github.xxx.net進行比較

其次,確保沒有其他GIT環境變量。 列出它們:

set GIT

這是為了檢查是否存在GIT_SSH環境變量,引用不同的 ssh 作為默認情況下您將與 Git 一起用於 Windows 的環境變量。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM