"Nashirak Bosk" <[EMAIL PROTECTED]> wrote:
> Ok. I have looked at all my options for creating account dynamically
> from a webpage, and have not come up with much. I want to create an
> user account that only creates a mail account. I think I can do this
> with the useradd command (I am running Linux). Like this:
>
> useradd accountname -s /bin/false then I could su into the
> accountname and run the passwd command.
>
> Now I could do this, with PHP using the popen() function. There is only
> 1 problem. I would have to run all this as root since only root is able
> to run this command. And even if I could it would be a big no no to
> somehow make PHP become root and then run this command. Any other
> suggestions on how to create an account dynamically with PHP or how to
> modify what I about the useradd command to get this to work? Thanks
I would recommend installing PHP as a CGI and making the script that calls
useradd owned by root and implementing some sort of authentication scheme to
prevent unauthorized use or I would write the useradd command to a database
(or text file) and have a bash script owned by root check it for entries
from a cron job and run the commands if entries are found.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]