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
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 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.