Windows Firewall, Tinywall and GIT

别说谁变了你拦得住时间么 提交于 2019-12-18 17:30:57

问题


Just finally updated to Win7 from XP.
I am using Windows Firewall with added Tinywall (gives more control)

But when I use Git Bash, the firewall blocks all commands. If I disable the firewall then everything works OK

I cannot figure the proper exceptions to add to TinyWall whitelist.

I added the shell window as well as the git.exe for application exceptions but still no go. These exceptions program paths I added:

C:\Program Files (x86)\Git\git-cheetah\..\bin\sh.exe
C:\Program Files (x86)\Git\bin\git.exe

Example of error:

$ git pull
ssh: connect to host xxx.xxx.xxx port 22: Bad file number
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

回答1:


To get TinyWall to work with git over SSH, you must white-list:

sh.exe
git.exe
ssh.exe

To work with git over HTTPS, you need only whitelist:

C:\Program Files (x86)\Git\libexec\git-core\git-remote-https.exe

or

C:\Program Files\Git\mingw64\libexec\git-core\git-remote-https.exe



回答2:


If restarting your shell on Widows (after setting the whitelist) doesn't work, a workaround would be to use the port 443 for your ssh git session.
See this answer, also detailed in GitHub "using ssh over the https port".

Or you can try and switch to an https url, if your server supports it.




回答3:


On Windows 10 with TinyWall i had to add exception for:

C:\Program Files\Git\mingw64\libexec\git-core\git-credential-manager.exe

in addition to:

C:\Program Files\Git\bin\git.exe

C:\Program Files\Git\bin\sh.exe

C:\Program Files\Git\mingw64\libexec\git-core\git-remote-https.exe



来源:https://stackoverflow.com/questions/23965340/windows-firewall-tinywall-and-git

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