|
|
 |
Re: FN-FORUM creating user using exec in PHP
date posted 8th January 2003 17:49
Quoting Alex Butcher [EMAIL REMOVED]
> A better way of doing this would be to do something like:
>
> groupadd -r webuseradd
> ; create a system group (-r) named webuseradd
> chown root.webuseradd /etc/passwd
> chown root.webuseradd /etc/shadow
> chmod g+rw /etc/passwd
> chmod g+rw /etc/shadow
> ; make /etc/shadow and /etc/passwd group writable and in the webuseradd
> ; group
>
> then have your PHP script run as a user in the webuseradd group.
Better still to have the PHP script write the username to a file and
then have a separate script run as root from cron to create the users.
If you need the id created immediately, have a daemon that reads a
socket or named pipe for the username and reports a success/fail
message back to the caller. Then have the PHP script talk to that.
That way you're not giving the webserver user any more privileges than
absolutely necessary.
James
|
 |
|