Creating System Users with PHP?

Fenix

Registered
I know this is possible on linux systems, but i dont have one of those to mess with so, i want to know if it is possible on OS X. I know a little about linux, and a little about OS X, and alot about windows :( which doesnt help me here. I am also pretty good with PHP, but i dont know how to get it to do the right calls to create a user. Thanks for your help :D

-Kevin
 
I remember reading somewhere - either in a book or in the developer documentation - the complete process for creating a user from the shell, using commands issued to netinfo from the command line.
I have spent 10 minutes hunting and can't seem to find it! I was however able to determine that the shell command used is called "niutil" and there is a man page there.
I assume you are trying to do this to batch-create a list of users.
Does anyone know where this shell script to create a user is documented?
 
So the next few questions are:
  1. What is the trick to get PHP to run these commads command-line?
  2. How are you going to make a PHP script that runs as "nobody" (or www or whatever) have the priveledges to "sudo" without hard coding the root password in the script? (which would be VERY BAD!)
  3. Is ther a way to create a new user without building a home directory?
  4. Once you have these users added as OS users, can you then somehow use them instead of that odd little .htaccess users file?
    [/list=1]
 
Back
Top