If Cygwin ssh, git, etc. can't find your .ssh directory
Mark Hansen
cygwin@mehconsulting.com
Fri Apr 24 13:46:46 GMT 2020
I had a case when I took my office laptop home and found that in the Cygwin environment,
commands were not able to find my .ssh directory. It seemed those commands didn't know
where my home directory was, and was defaulting to "/".
After asking on the Cygwin newsgroups, I received the following comment:
-------------------------------------------------------------------------
I also have had to deal with this problem. You should certainly read
https://cygwin.com/cygwin-ug-net/ntsec.html.
After much experimenting and consultation with Corinna, we decided the
best solution for me was:
* Create /etc/passwd and /etc/group files
o For /etc/passwd, I included just my account, and I actually
editted it further to use my preferred username (rather than my
domain username) and my correct home directory
* Edit /etc/nsswitch.conf with:
o passwd: files
o group: files
This is not the generally recommended configuration, but in the
situation where you cannot reach the domain server, it may be the best
alternative. You may or may not need to back these changes out when you
are back at work. I have not had a problem at work, but we are only
loosely connected to the domain, so YMMV.
-------------------------------------------------------------------------
After making the changes, I rebooted the machine and now it seems to work.
Note that when using the PC from home, I also had to set the HOME environment
variable in the environment variable settings.
More information about the Cygwin
mailing list