Re: FTP controlled by SQL

From: Mark Johnston (mjohnston_at_skyweb.ca)
Date: 03/16/05

  • Next message: Matt Ferris: "Re: FTP controlled by SQL"
    To: "Scott St. John" <scott@scottah.com>
    Date: Wed, 16 Mar 2005 13:54:23 -0600
    
    

    On Wed, 2005-03-16 at 13:45 -0500, Scott St. John wrote:
    > I have a client who wants to be able to add/remove users to an FTP site.
    > They do not have access to the machine so this sounds like a job for PHP and
    > MySQL. I have been trying (pulling hair out) with Proftp and MySQL.
    >
    > My question is: is anyone on the list doing something like this and what
    > are you using?

    I'm doing something very like this, using the ProFTPD port version
    1.2.10_1 and PostgreSQL. Relevant config chunks:

    AuthPAM off
    DefaultRoot ~
    SQLConnectInfo dbname@db.host.fqdn username password
    SQLAuthenticate users # Could also use groups
    SQLAuthTypes Plaintext # Passwords are stored as plaintext
    SQLHomedirOnDemand on # Create missing home directories
    SQLNegativeCache on # Cache missing usernames
    SQLDefaultGID 10000 # Everyone will get this GID
    SQLMinUserUID 10000 # Users must be at least UID 10000
    SQLNamedQuery getuser SELECT "name, password, uid, NULL, '/home/' ||
    name, NULL FROM domain WHERE name = '%U' AND enabled"
    SQLUserInfo custom:/getuser

    Basically, this turns off PAM, and authenticates using the given SQL
    query. It doesn't use groups (everyone gets the DefaultGID of 10000).
    The order in the SQLNamedQuery is significant - it's name, password,
    numeric uid, numeric gid, home directory, something else (sorry). %U is
    the username the user entered.

    Management of the database table is done with an internal web front-end,
    but it's a trivial matter of programming anyway. PHP sounds eminently
    suitable.

    HTH,
    Mark

    _______________________________________________
    freebsd-isp@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-isp
    To unsubscribe, send any mail to "freebsd-isp-unsubscribe@freebsd.org"


  • Next message: Matt Ferris: "Re: FTP controlled by SQL"