Page 1 of 1

adduser in linux using php

Posted: Tue Mar 02, 2004 10:46 am
by jro
can someone help me with the coding to add user in linux using php.thanks.

Posted: Tue Mar 02, 2004 10:49 am
by ol4pr0
You want to add a user within youre linux system from within php?

[advice]

If it is possible @ all, dont do it lol

Posted: Tue Mar 02, 2004 11:18 am
by kettle_drum
Just use exec() and other such commands to run commands - but as ol4pr0 said its a bit dangerous.

Posted: Tue Mar 02, 2004 12:15 pm
by ol4pr0
Personally i dont use *nix for its functionallity, more for its secure way of whatever... if i wanted some code to be able to execute and or add whatever on my system i would of continue being friends with 'B Gates'

Posted: Fri Mar 05, 2004 1:22 am
by Pyrite
This can only be done if the user that is running Apache or whatever web server you use has access to the adduser command. I would suggest setting sudo so that Apache's user (be it nobody or apache or http) can make use of adduser. This would probably be the safest way, but even then, very insecure!

Posted: Fri Mar 05, 2004 4:21 am
by timvw
I'd have my users in a ldap tree, and then make a php script that talks with that ldap server...

If using /etc/password etc you'll have to run things as root etc, and that can (and probably will) be a pain in the ass...