简体   繁体   中英

How to fix Cygwin using wrong .ssh directory no matter what I do?

On my Cygwin machine $HOME is cygwdrive/c/Users/me (ie 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM