windows - 尽管有效的 SSH 身份验证,但 Git 的权限被拒绝
问题描述
今天早上我的 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 for Windows 一起使用的 ssh。
推荐阅读
- php - 当我在 codeigniter 中输入无效的验证码时,我没有看到错误消息
- javascript - 在页面中拖动的菜单
- java - 如何在 Java 7+ 中实现确定性 GC 暂停?
- java - 为什么activity_main.xml 没有在Android Studio 中显示我的组件,为什么28 API 不起作用?
- python - 如何检查单元格中的值是否在范围内。基于将不同的“分数”分配给新列
- java - Vert.x Auth JWT 中的身份验证失败原因
- php - Laravel,如何使用 ajax 提交显示表单错误?
- excel - 计算两个日期之间的间隔,每个日期有两列
- javascript - 处理 SQL/PHP 输出并转换成 java
- ocaml - 带有可选和可变字段的记录