git ssh 问题

git ssh 问题

我有一个 git repo,我正在尝试在远程使用此命令。

$ git push origin master
ssh: connect to host  port 22: Bad file number
fatal: The remote end hung up unexpectedly.

我正在尝试使用 GitBash 来做到这一点。

我通常只通过 Putty 使用 ssh 登录,所以我知道我的密钥有效并且在那里。我需要做什么来解决这个问题?

答案1

https://stackoverflow.com/questions/4399106/pushing-to-github-from-work-bad-file-number-error有一个可接受的答案,表明问题可能是由尝试通过代理推送引起的。我不确定这在 SSH 中是如何工作的,但既然答案已被接受,我预计问题出在代理上,修复它或将其从方程式中删除即可解决问题。

答案2

无需代理,完全使用本地网络。

请发布输出git config -l,或者至少git config --get http.proxy

我可以使用 Putty 和 id_sha 密钥登录机器。但是Permission denied (publickey). fatal: The remote end hung up unexpectedly当我尝试使用 git bash 时,出现了以下错误:

您看过 s​​shd 日志了吗?

不管怎样,使用 HTTP 来推送看看会发生什么:

# git remote rm origin
# git remote add origin https://git.domain.com/project/repo.git
# git config --global http.sslVerify false
# git push origin master

相关内容