“无法产生ssh”当连接到Github时,但ssh -T git@github.com的作品? [英] "Cannot spawn ssh" when connecting to Github, but ssh -T git@github.com works?

查看:913
本文介绍了“无法产生ssh”当连接到Github时,但ssh -T git@github.com的作品?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很难获得Github(+ Netbeans的工作)。



我想在git上使用ssh(在Windows 7上),例如提交或克隆一个项目,但我一直收到这个错误消息:

  $ git clone git@github.com:USER / PROJECTNAME.git 
错误:无法产生C:\程序文件(x86) \Git\bin\ssh.exe:没有这样的文件或目录
致命:无法分支

注意:现在,我的 GIT_SSH 环境变量指向 C:\程序文件( x86)\Git\bin\ssh.exe ,但我也试过 C:\程序文件(x86)\Git\bin ,完全擦除它,指向putty / plink的文件夹,指向它们的可执行文件,但仍然是相同的消息。



当我测试连接时,一切正常:

  $ ssh -T git@github.com 
您好!您已成功通过身份验证,但GitHub不提供shell访问权限。

我做错了什么?如果我首先在目录中执行 git init ,那么它有什么不同吗?



编辑



这并没有帮助:

设置 GIT_SSH plink.exe 并将plink的路径添加到 PATH



**编辑2 **



命令结果 GIT_TRACE = 2

  $ GIT_TRACE = 2 git clone git@github.com: XXX / AffableBean 
trace:内置:git'clone''git@github.com:XXX / AffableBean'
克隆到'AffableBean'...
trace:run_command:'Plink .exe''-batch''git@github.com''git-upload-pack'\''XXX / AffableBean'\\'''
错误:无法产生Plink.exe:没有这样的文件或目录
致命:无法分叉


解决方案

这确实令人尴尬,但真正的问题出在我的防火墙 Comodo Firewall 它以某种方式阻止了由 git 初始化的ssh连接。



我可以通过ssh无任何问题连接,例如使用命令行或Putty,但以某种方式 Comodo 导致这个奇怪的问题。



感谢大家的支持!


I am having a hard time getting Github (+Netbeans to work).

I want to use ssh with git (on Windows 7) to, e.g., commit or clone a project, but I keep getting this error message :

$ git clone git@github.com:USER/PROJECTNAME.git
error: cannot spawn C:\Program Files (x86)\Git\bin\ssh.exe: No such file or directory
fatal: unable to fork

Note: For now, my GIT_SSH environment variable is pointing to C:\Program Files (x86)\Git\bin\ssh.exe, but I have also tried C:\Program Files (x86)\Git\bin, erasing it entirely, pointing to putty's/plink's folder, and pointing to their executables, but still the same message.

When I test the connection everything works fine:

$ ssh -T git@github.com
Hi USER! You've successfully authenticated, but GitHub does not provide shell access.

What am I doing wrong? Does it make a difference if I do the git init in the directory in the first place?

EDIT:

This didn't help:

setting GIT_SSH to plink.exe and adding plink's path to PATH

**EDIT 2 **

result of command with GIT_TRACE=2

$ GIT_TRACE=2 git clone git@github.com:XXX/AffableBean
trace: built-in: git 'clone' 'git@github.com:XXX/AffableBean'
Cloning into 'AffableBean'...
trace: run_command: 'Plink.exe' '-batch' 'git@github.com' 'git-upload-pack '\''XXX/AffableBean'\'''
error: cannot spawn Plink.exe: No such file or directory
fatal: unable to fork

解决方案

This is really embarrassing but the real problem was with my firewall Comodo Firewall which somehow was blocking the ssh connection from being initialized by git.

I can without any problems connect via ssh e.g. using command line or Putty but somehow Comodo was causing this weird issue.

Thanks everyone for support!

这篇关于“无法产生ssh”当连接到Github时,但ssh -T git@github.com的作品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆