Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

By examining the /etc/passwd I should get a list of all users in the system. However, when dumping the passwd file on Mac OS X I don't see my current username but many entries like these:

  _xgridagent:*:86:86:Xgrid Agent:/var/xgrid/agent:/usr/bin/false
  _appowner:*:87:87:Application Owner:/var/empty:/usr/bin/false
  _windowserver:*:88:88:WindowServer:/var/empty:/usr/bin/false
  _spotlight:*:89:89:Spotlight:/var/empty:/usr/bin/false
  _tokend:*:91:91:Token Daemon:/var/empty:/usr/bin/false

How come that I can log into the shell with my username and when I do "who" I see my username?

share|improve this question

migrated from stackoverflow.com Sep 22 '10 at 1:56

This question came from our site for professional and enthusiast programmers.

4 Answers 4

up vote 13 down vote accepted

The /etc/passwd file is only consulted when the o/s is in single-user mode. The "standard" location for account information on OS/X is the DirectoryService

Try man DirectoryService for more information.

The following comment block appears at the top of my password file

##
# User Database
# 
# Note that this file is consulted directly only when the system is running
# in single-user mode.  At other times this information is provided by
# Open Directory.
#
# This file will not be consulted for authentication unless the BSD local node
# is enabled via /Applications/Utilities/Directory Utility.app
# 
# See the DirectoryService(8) man page for additional information about
# Open Directory.
##

In recent versions of OS X Directory Utility has been moved to /System/Library/CoreServices/Directory Utility.

share|improve this answer
    
I went looking for something like that (Directory Utility) - and it isn't there in my Snow Leopard install...any idea what I could be missing - how it got there on yours? –  Jonathan Leffler Sep 21 '10 at 17:09
    
Hmmm...Apple says "Mac OS X v10.5 includes two utilities used to bind computers to Microsoft Active Directory. Directory Utility is an application, and dsconfigad is a command-line utility accessed through Terminal. Both may be used to configure the Active Directory connector in Directory Utility." –  Jonathan Leffler Sep 21 '10 at 17:23
    
It's not installed in the advertised location, nor does it appear in spotlight. Looks like my password file is lying to me. –  Steve Weet Sep 21 '10 at 17:28
    
My password file tells the same fib. I did find dsconfigad. –  Jonathan Leffler Sep 21 '10 at 22:41
2  
Added the new location of directory utility. –  Alan Shutko Aug 22 '13 at 19:40

Mac OS X uses Open Directory.

share|improve this answer

There is a set of Directory Services which keeps the information. There are a series of command line tools (dscl for one) to manipulate them (hard) or you can use System Preferences to handle some of them.

share|improve this answer

OS X doesn't use the UNIX/LINUX /etc/passwd files. Instead, it stores it in NetInfo. The command used to interact with NetInfo is the directory service command utility, or dscl.

I'm not familiar with the commands, but I'm sure a simple man dscl wouldn't hurt anyone.

share|improve this answer
2  
NetInfo was replaced by Directory Services as of Mac OS X 10.5 and newer. –  Chealion Oct 1 '10 at 2:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.