dscl
is the command line utility to maintain OSX's user/group databases. To explore what's there, sudo dscl .
to get its command line, then list /Users
. To see the definition for a given user, use read /Users/admin
. As you might expect, removing it is delete /Users/admin
. (There's also a help
command.)
For scripting, you can do these from the command line:
$ sudo dscl . -read /Users/admin
That is, just add a -
before the command name.
I'm pretty sure DirectoryService names must be unique, so I assume that your existing admin
is admin
and the bogus one must be admin␣
or something silly like that. Alternately, you might have one defined in /etc/passwd
and one in DirectoryServices; the former will only be used during system boot, before /usr/sbin/DirectoryService
is running.
I'm aware of dscl and have examined the users -- they are identical with the exception of GeneratedUID. – ZaMoose – 2011-03-22T19:58:08.547
Looks like you can include that GeneratedUUID to select the specific record.
dscl . -delete /Users/admin GeneratedUUID mumble
. – geekosaur – 2011-03-22T20:18:21.933