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

柔情痞子 提交于 2021-01-27 18:54:26

问题


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

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