Git SSH client for windows and wrong path for .ssh

2019-01-13 04:26发布

问题:

I installed Git-1.7.9-preview20120201.exe, and when I try to access my repository via SSH it failed.

I investigated and found that if I run SSH -T git@myrepo.com, SSH doesn't load ~/.ssh/config where a custom port is defined.

When I try SSH -F c:\users\tomas\.ssh\config git@myrepo.com everything is OK.

I used Process Monitor and found that SSH is trying to find \\\\.ssh\config here C:\Windows\CSC\v2.0.6\namespace\.ssh.

Why?

How I can force it to use normal path? %HOMEPATH%\.ssh\config?

回答1:

set the HOME environment variable pointing to %USERPROFILE% for ssh to pick it up. This usually seems to be the problem for many unix solutions that run on windows.

Fast access to set user env variables:

Start > Type "env" > Select "Environmental variables for your account"



回答2:

I found that windows msygit port store ssh config here <installPath>\Git\etc\ssh\ssh_config



标签: windows git ssh