Rule conflict between multiple SSH

限于喜欢 提交于 2019-12-12 02:48:43

问题


As I try to use grunt-rsync, I come to a "code 12" error, my understanting is that I have a conflict between multiple ssh installed on my computer (Git's and cwRsync's) :

where ssh
C:\Program Files\cmder\vendor\msysgit\bin\ssh.exe
C:\Program Files\cwRsync\ssh.exe
C:\Program Files (x86)\Git\bin\ssh.exe

How can I resolve that conflict ?

Thanks a lot.


回答1:


Your msysgit ssh version is taking precedence over the cwrsync one, this causes issues.

You either need to change you PATH environment variable or create a batch file to override it.

@echo off
SETLOCAL
SET CWRSYNCHOME=C:\Program Files\cwRsync
SET HOME=c:\Users\*YourUserName*\
SET CWOLDPATH=%PATH%
SET PATH=%CWRSYNCHOME%\bin;%PATH%
"C:\Program Files\cwRsync\bin\rsync.exe" %*

(Note: the above also sets the home directoy. You should point this to your .ssh (keys) directory)




回答2:


I managed to fix this problem by simply adding a single line to my .bashrc file:

export PATH=/c/Program\ Files/cwRsync/:$PATH

This adds the cwRsync directory to the beginning of your PATH environment variable, which means that its copy of ssh moves to the top of the list when you do where ssh and consequently becomes the default.

For me, this fixed problems I was having running the grunt-rsync Grunt task from msysgit (I mention it in case anyone else is having the same problem).



来源:https://stackoverflow.com/questions/32756423/rule-conflict-between-multiple-ssh

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!