错误:无法运行 ssh:尝试在 Windows 上克隆时没有这样的文件或目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12569705/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
error: cannot run ssh: No such file or directory when trying to clone on windows
提问by Malloc
I am trying to clone on windows a remote repository, so when i did this:
我试图在 Windows 上克隆一个远程存储库,所以当我这样做时:
git clone [email protected]:organization/xxx.git
I got this error:
我收到此错误:
error: cannot run ssh: No such file or directory
fatal: unable to fork
Am i missing something ? Thanx in advance.
我错过了什么吗?提前谢谢。
回答by Mark
You don't have ssh installed (or don't have it within your search path).
您没有安装 ssh(或者您的搜索路径中没有安装它)。
You can clone from github via http, too:
您也可以通过 http 从 github 克隆:
git clone http://github.com/organization/xxx
回答by pablorsk
Check if you have installed ssh-client
. This solve the problem on docker machines, even when ssh keys are present:
检查您是否已安装ssh-client
. 这解决了 docker 机器上的问题,即使存在 ssh 密钥:
apt-get install ssh-client
回答by rivanov
Most likely your GIT_SSH_COMMAND
is referencing the incorrect public key.
很可能您GIT_SSH_COMMAND
引用了不正确的公钥。
Try:
尝试:
export GIT_SSH_COMMAND="ssh -i /home/murphyslaw/.ssh/your-key.id_rsa
then
然后
git clone [email protected]:organization/xxx.git
回答by user1556814
I had this issue right after my antivirus moved the cygwin ssh binary to virus vault, and restored it after.
在我的防病毒软件将 cygwin ssh 二进制文件移动到病毒库后,我立即遇到了这个问题,并在之后将其恢复。
Symptoms:
症状:
- SSH seems properly installed
- SSH can be run from command line without problem
- SSH 似乎已正确安装
- SSH 可以毫无问题地从命令行运行
Another option before reinstalling ssh in this particular case: check the ssh
command permissions
在这种特殊情况下重新安装 ssh 之前的另一个选择:检查ssh
命令权限
$ ls -al /usr/bin/ssh.exe
----rwxrwx+
$ chmod 770 /usr/bin/ssh.exe