Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am unable to find the etc/passwd file in cygwin

Tags:

cygwin

passwd

I recently installed cygwin, and have been unable to find my passwd/etc file in order set to HOME. Is there any way to force cygwin to generate the file?

like image 484
0x6 Avatar asked Feb 18 '15 00:02

0x6


People also ask

Where is etc passwd file in Windows?

Windows provides the ability to create a UNIX-style passwd file located in the %SYSTEMROOT% \system32\drivers\etc directory. This file can be used to map existing Windows users to UNIX UID and GID values.

What is the ETC passwd file?

The /etc/passwd file is a text-based database of information about users that may log into the system or other operating system user identities that own running processes. In many operating systems this file is just one of many possible back-ends for the more general passwd name service.


2 Answers

The /etc/passwd and group files are no longer generated by default, starting with Cygwin 1.7.34.

You can still generate them. Cygwin will use these files preferentially if present, by default, but only to cater to existing installs and special situations.

When these files are not present, Cygwin now uses the native Windows user management mechanisms: Active Directory where present, or SAM where not.

It is therefore recommended that you use this new mechanism to change your home directory. The easiest way I know of to do this is to add a line like this to your /etc/nsswitch.conf file:

db_home: /%H

That will change your Cygwin home directory to be equal to your Windows user profile directory. There are many other legal % tokens you can use here to achieve different results. See the previous link for details.

like image 129
Warren Young Avatar answered Sep 23 '22 13:09

Warren Young


In my case, I set db_home: /%H in /etc/nsswitch.conf file, and change permission of my .ssh dirctory to "full control".

like image 40
Oskar Avatar answered Sep 23 '22 13:09

Oskar