Creating a user from the command line

Fahrvergnuugen

I am the law!
Does anyone know how to create a new user from the command line?

I forgot to burn a CD for a friend back at school before I left [my computer is still at school running, but its logged out]

So what I want to do is ssh into my computer, create a login for him, copy the files for the CDR from my home directory to his so he can login and burn the CDR. The user would only be temporary.
 
This is one area I hate OS X/darwin compared to other UNIX's. It's not a simple adduser/useradd command. You need to use NetInfo. niutil I think it is? I haven't gotten to that yet in my Mac OS X For UNIX Geeks book. You'll get better responses I think in the UNIX forum.

Good luck.
 
make sure you're in (t)csh:

> set NEWUSER="/ /users/temp"

> niutil -create $NEWUSER
> niutil -createprop $NEWUSER uid 800
> niutil -createprop $NEWUSER expire 1
> niutil -createprop $NEWUSER home /tmp

and so on...

Just type in 'niutil' and it will show the available options.

Notice that '/users/bill' is a path in the NetInfo DB and not a local path. '/' specifies the DB itself.

And don't forget 'passwd temp' after all...
 
Back
Top