you need to make sure that the web has permission to use that file .. my
guess is it don't have permission hence why you can run add.sh from the
command line (where your not your web user I'm assuming).

> -----Original Message-----
> From: tim tom [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 18 September 2002 10:56 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] adding unix account via system command
>
>
> php4.2.3 apache mod
> linux rh7.2
> -------------------
>
> I am trying to add unix system account user via a simple php and
> shell script
> <?
> system("/usr/bin/add.sh timtom752002 timtom752002
> /home/timtom752002",$r) or die (" $r user
> creation fail");
>
> print "success";
> ?>
>
> when i ran add.php on my browser, i get
>  254 user creation fail
>
> I created my add.sh file in /usr/bin and I have setuid it:
> -rwsr-xr-x    1 root     devel         216 Sep 18 08:54 add.sh
>
> It looks like:
> #!/bin/sh
>
> username=$1
> password=$2
> homedir=$3
> # create user
> /usr/sbin/useradd -m -d $homedir $username
>
>
> # change the password
> (
> echo $password
> sleep 1
> echo $password
> sleep 1
> echo $password
> )|passwd $username
>
> When I ran the add.sh from the command line, it works ok:
> $ /usr/bin/add.sh nnnnn nnnnn /home/nnnnn
> Changing password for user nnnnn
> passwd: all authentication tokens updated successfully
> (i tried login in with uid=nnnnn and passwd=nnnnn and it was ok)
>
> What's wrong with those scripts. It DOESN'T even create the user
> timtom752002. Please help
>
> --
> tim
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Autos - Get free new car price quotes
> http://autos.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to