From: Peter Booth Date: 2009-10-13T10:24:57+09:00 Subject: Re: Etc.passwd on OS X --Apple-Mail-4-64502546 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Steven, OS/X doesn't use the Unix/Linux /etc/passwd and /etc/group files. Instead it uses netinfo (or another directory service). There's a command line tool dscl that is quite powerful. See below (ignore the names) or look at the manpages for dscl Peter # Create user mr-potato-head sudo "/usr/bin/dscl . -create /Users/mr-potato-head UniqueID 2400" sudo "ditto --rsrc '/System/Library/User\ Template/ English.lproj/' /Users/mr-potato-head" sudo "chown -R mr-potato-head /Users/mr-potato-head" sudo "/usr/bin/dscl . -create /Users/mr-potato-head NFSHomeDirectory /Users/mr-potato-head" # mr-potato-head user needs admin access sudo "/usr/bin/dscl . -append /groups/wheel GroupMembership mr- potato-head" # Create user mr-radish sudo "/usr/bin/dscl . -create /Users/mr-radish UniqueID 2410" sudo "ditto --rsrc '/System/Library/User\ Template/ English.lproj/' /Users/mr-radish" sudo "chown -R mr-potato-head /Users/mr-radish" sudo "/usr/bin/dscl . -create /Users/mr-radish NFSHomeDirectory / Users/mr-radish" sudo "/usr/bin/dscl . create /Groups/vegetable PrimaryGroupID 2420" sudo "/usr/bin/dscl . append /groups/vegetable GroupMembership mr- potato-head" sudo "/usr/bin/dscl . append /groups/vegetable GroupMembership mr- radish" On Oct 12, 2009, at 8:28 PM, Steven Hansen wrote: > > Hi, > > I'm wondering if anyone knows how the Etc class locates users for OS > X. > > The documentation suggests that it simply parses the /etc/passwd file > and returns a list of the users in there. However, I don't think this > is true for OSX. When I look through my /etc/passwd file I notice > that > there are several users missing, including the username that Iogin > with. > > However, the Etc class still manages to find all of the users on my > system... For OSX, does the Etc class inspect an alternate file? If > so, what file is it getting its information from? > > > Thanks, > Steven > -- > Posted via http://www.ruby-forum.com/. > --Apple-Mail-4-64502546--