Creating ftp account with PHP

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
eeRuheeRu
Forum Newbie
Posts: 3
Joined: Wed Dec 11, 2002 2:46 am
Location: Estonia

Creating ftp account with PHP

Post by eeRuheeRu »

The point is, that i must to create an ftp user, using my perl script:

---PHP---
exec ('myscript.pl username passwd')
----------

---myscript.pl---
$username = $ARGV[0];
$pw = $ARGV[1];

system ('pw useradd $username -n $username -d /home -s /nologin -m');
system ('echo $pw | pw usermod -n $username -h 0 ');
exit(0);
----

In my case apache must have root privileges to execute pw command, there is my problem, giving to apache rights to execute pw is a security hole. I thought is it possible to configure apache so, that it can execute pw only in one directory (e.g /usr/local/myweb)? Or does anyone has done such a things before and can help me :(
Post Reply