RTFM

[Read This Fine Material] from Joshua Hoblitt

OSX account creation: Think Different, Think WTF?

| 0 comments

This has to be my absolute favorite “innovation” from Apple. Why run just two simple commands to create an new user account, like so:

useradd -d /home/foo -c”foo” -s/bin/bash -u 500 -g 100 -m foo; passwd foo

? I mean, that doesn’t even give the systems administrator a big sense of accomplishment for rote memorization of a massive pile of commands. Or why even pretend to be like most POSIX systems, except for in ad champagnes? Enter OSX — account creation from the command line requires the execution of 9 (yes, 9!) separate commands:

dscl / -create /Users/foo
dscl / -create /Users/foo UserShell /bin/bash
dscl / -create /Users/foo RealName “foo”
dscl / -create /Users/foo UniqueID 500
dscl / -create /Users/foo PrimaryGroupID 100
dscl / -create /Users/foo NFSHomeDirectory /Local/Users/foo
dscl / –passwd /Users/foo foobar
mkdir /Users/foo
chown foo:100 /Users/foo

Seeessssh. I have to admit, that certainly is different.

Leave a Reply