[thelist] Creating FTP Users with PHP

Hans Zaunere zaunere at yahoo.com
Tue Apr 2 16:50:01 CST 2002

--- Jake Aust <mail_lists at jakesdiner.com> wrote:
> Is it possible to create a new user in a Linux system suing PHP.

Sure it is, however something that you must be very careful about.  For
one, I wouldn't make real system accounts.  I assume you are using
ProFTPd's virtual accounts and hosting, so you should only work with
those files.

PHP can execute any system/shell command, running with the permissions
of Apache.  So, you should setup a uid/gid scheme where HTTPD has
access to your FTP access files (ie /usr/local/proftpd/etc/ftppasswd ).
 You can also have PHP run an external/SUID program or use suEXEC
within Apache.  This is often not as desireable however.  Also remember
that if all your services are running as the 'nobody' user, you
suddenly have a user that is somebody.

However you decide to do it, try to keep your script as small and
simple as possible, and take all safeguards with PHP security (global
variables off, for example).

Another option, which may be better, is to use ProFTPd's external
authentication abilities, ie to MySQL.  If you're using PAM, you can
setup a system that completely authenticates to an external source (you
can do without, however it's not that easy).

Just keep on your toes,

Hans Zaunere
New York PHP

> want to
> allow an admin page to create a new user that would create a home
> directory
> for the user and create a username/password that would authenticate
> in the
> FTP server.
> How would you go about this. I am on Linux/Apache1.3/ProFTPD, running
> a
> bunch of Virtual Hosts. I would only want the user to be allowed to
> log in
> to their own virtual host.
> Is this making sense?
> Jake
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !

Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

More information about the thelist mailing list