[wplug] add users via scripts

John Harrold jmh17 at pitt.edu
Wed Sep 17 17:11:40 EDT 2003


Sometime in September Chris assaulted the keyboard and produced:

| I know that is going to sound bad, but I can't think of any better
| solutions.  I want to be able to add users to the system via a php page.
| The problem that I am running into is how do I call/usr/sbin/useradd without
| added the user "apache" to the root group.  Is it possible without leaving
| the system wide open?  Oh, the next command that would be ran would be
| /usr/sbin/usermod -s /sbin/nologin $user.  This is for adding mail only
| users.  I can do it using shell scripting but only if I'm root.  Here are
| the commands that I want to run.
| 
| /usr/sbin/useradd $user;
| /bin/su $user -c "/var/qmail/bin/maildirmake ~/Maildir/";
| /usr/sbin/usermod -s /sbin/nologin $user;
| echo "$pass" | /usr/bin/passwd $user;
| /bin/cp ./.qmail /home/$user/;

checkout 'sudo'. give the user your scripts are running under, apache,
permissions to run this file as root.

-- 
--------------------------------------------------------------------------
                                               | /"\
 john harrold                                  | \ / ASCII ribbon campaign
      jmh at member.fsf.org                    |  X  against HTML mail
           the most useful idiot               | / \
--------------------------------------------------------------------------
 What difference does it make to the dead, the orphans, and the homeless,
 whether the mad destruction is brought under the name of totalitarianism or
 the holy name of liberty and democracy?
 --Gandhi
--------------------------------------------------------------------------
gpg --keyserver keys.indymedia.org --recv-key F65A739E
--------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://penguin.wplug.org/pipermail/wplug/attachments/20030917/ee3644f0/attachment-0001.bin


More information about the wplug mailing list