Page 1 of 1

Add new system users with exec() ??

Posted: Mon Apr 19, 2004 2:54 am
by samsbox
I want to be able to add new users to my Linux box using PHP's exec() command.

Can it be done? If so, could someone please explain how...

All help is appreciated, so thanks for your time :)

Posted: Mon Apr 19, 2004 6:45 am
by kettle_drum
Of course it can. You can either use exec() or system() to run a command to add a user - just like you would if you were on the command line.

Or you can open the passwd file and insert the line by hand. Or you can use exec() or system() again to do something like exec('echo blah:::: > etc/passwd');