users and /etc/passwd

callieX

Registered
What is the relationship between the Users Gui and /etc/passwd file in OSX. I noticed that administrator user that was setup at installation is not is the /etc/passwd file. I created a postgres user with the GUI and it is also not in the /etc/passwd file. Isn't /etc/passwd the place for users in order to setup home directories and shell preference.

CallieX
 
The relationship is none. Darwin, when in multi-user mode, does not use /etc/passwd, nor any of the other "flat files". to add a user, you can do it from the users panel of system preferences, or open NetInfo Manager, and add a user manually. you have to put in all the correct keys to the passwd directory of your local domain. you can do the same thing with the niutil -createprop command.

if you have created users in the flat files, you can load them to the netinfo directory structures with the niload command. for example, to load your users from /etc/passwd to netinfo, use this: niload passwd . < /etc/passwd.

note that the flat files do get used in single user mode.
 
Back
Top