Re: How to add user to linux using php

From: Date: Tue, 05 Sep 2006 12:36:21 +0000
Subject: Re: How to add user to linux using php
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-241370@lists.php.net to get a copy of this message
J R wrote:
1. give user apache the addusser priviledge (which is very unsecure), then execute shell_exe as root would. 2. create a root process like a cron job which will start at boot of your server, then on your shell_exe pass your command to that process and have that root process execute that command (bit more secure). Or create a simple shell/perl/php/whatever wrapper for adduser, and allow sudo for that wrapper by the web server user only.
For example, you could create a wrapper that only allows one alphanumeric argument for the username, and another for the password. The wrapper could use defaults like /home/webusers/<username>, and /bin/false as the shell, etc, etc. jon

« previous php.general (#241370) next »