adduser in linux using php

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
jro
Forum Newbie
Posts: 3
Joined: Tue Mar 02, 2004 10:38 am

adduser in linux using php

Post by jro »

can someone help me with the coding to add user in linux using php.thanks.
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post 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
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Just use exec() and other such commands to run commands - but as ol4pr0 said its a bit dangerous.
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post 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'
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post 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!
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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...
Post Reply