Managing Users and Passwords

The Directory Services equivalent of the passwd file resides under the /users portion of the directory. Although Mac OS X includes /etc/passwd and /etc/master.passwd files, they are consulted only while the system is in single-user mode, or if the system has been reconfigured to use BSD Flat Files (see Section 3.3, earlier in this chapter).

To add a normal user to your system, you should use System Preferences Accounts. However, if you want to bulk-load NetInfo with many users or create a user while logged in over ssh, you can use dscl or niload.

You can list all users with the nireport utility. Supply the NetInfo domain (., the local domain), the directory (/users), and the properties you want to inspect (uid, name, home, realname, and shell):

$ nireport . /users uid name home realname shell  -2 nobody /var/empty Unprivileged User /usr/bin/false 0 root /var/root System Administrator /bin/sh 1 daemon /var/root System Services /usr/bin/false 99 unknown /var/empty Unknown User /usr/bin/false 25 smmsp /private/etc/mail Sendmail User /usr/bin/false 2 lp /var/spool/cups Printing Services /usr/bin/false 27 postfix /var/spool/postfix Postfix User /usr/bin/false 70 www /Library/WebServer World Wide Web Server /usr/bin/false 71 eppc /var/empty Apple Events User /usr/bin/false 74 mysql /var/empty MySQL Server /usr/bin/false 75 sshd /var/empty sshd Privilege separation /usr/bin/false 76 qtss /var/empty QuickTime Streaming Server /usr/bin/false 77 cyrus ...

Get Mac OS X Panther for Unix Geeks, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.