问题
On my Cygwin machine $HOME
is cygwdrive/c/Users/me
(i.e. not the sometimes default of /home/me
) which I appreciate.
However, when I am using git, and trying to use ssh keys, it always checks in /home/me/.ssh
for my keys.
To get around this, I tried this solution however, putting a config
file in ~/.ssh
doesn't work because I then have copy that same file to /home/me/.ssh
because that is where git (when run from Cygwin) looks.
Is there some way I can avoid this? As it stands right now I have to duplicate the file in each place or link them (which I want to avoid). What I do not understand is why git insists on thinking my home folder is different than it actually is.
回答1:
As explained on Cygwin mailing list:
https://cygwin.com/ml/cygwin/2016-06/msg00404.html
OpenSSH never honors $HOME. It checks explicitely for your home dir setting in the user DB. See https://cygwin.com/cygwin-ug-net/ntsec.html for various methods setting your home dir.
来源:https://stackoverflow.com/questions/39551802/how-to-fix-cygwin-using-wrong-ssh-directory-no-matter-what-i-do