Pureftpd Permissions Problem

Discussion in 'Server Operation' started by GaulHahn, Dec 17, 2006.

  1. GaulHahn

    GaulHahn New Member

    Firstly thanks for the excellent how to's on this site they are a really valuable source of info!.

    I have followed the installation of Virtual Hosting With PureFTPd And MySQL here. I'm running this on Ubuntu 6.06.1 Server.

    However i'm having problems with the permissions as follows:

    If I create a user and log onto the ftp server it creates the relevant directory with the ftpuser:ftpgroup permissions which is fine and i can upload data, mkdir etc. However because Apache is running as www-data:www-data If I try to run anything that needs rwx to those directories (for example joomla) it is unable due to the permissions being that of the ftpuser:ftpgroup.

    Obvioulsy if I chown the directories to www-data:www-data it fixes the problem and joomla can be used but then the ftpuser is unable to mkdir, upload data etc.

    I'm guessing it something fairly simple but i'm still learning :rolleyes: What am I missing?
  2. falko

    falko Super Moderator ISPConfig Developer

    A solution is to run either Apache as ftpuser:ftpgroup or Pureftpd as www-data:www-data.
  3. GaulHahn

    GaulHahn New Member

    Thanks for your response Falko!

    I discovered another way around this problem. By default (on Ubuntu 6.06.1 at least) /etc/pure-ftpd/conf/MinUID has a value of 1000

    I set /etc/pure-ftpd/conf/MinUID to "1" which allows www-data UID 33 to log on to the FTP server. Then if I set the User in the MySQL database with UID and GID 33 it works fine.

    On Ubuntu 6.06.1 pure-ftpd-mysql runs this:

    /usr/sbin/pure-ftpd-mysql -l mysql:/etc/pure-ftpd/db/mysql.conf -l pam -u 1000 -E -A -O clf:/var/log/pure-ftpd/transfer.log -j -B

    From the man pages:

    - '-u <uid>': Don't allow uids below <uid> to log in. '-u 1' denies access
    to root (safe), '-u 100' denies access to virtual accounts on most Linux

    Cheers :)
    Last edited: Dec 19, 2006
    biforme likes this.
  4. _X_

    _X_ New Member

    can this be done for proftpd in:

    # Set the user and group that the server normally runs at.
    User www-data
    Group www-data
  5. falko

    falko Super Moderator ISPConfig Developer

    Theoretically yes, but why would you want to do this?
  6. _X_

    _X_ New Member

    to alow admin user for site that runs joomla to modify files with ftp connection in joomla instalation because they are all www-data:www-data ?

    is this unsecure procedure?
  7. falko

    falko Super Moderator ISPConfig Developer

    To do this, you'd have to log in as www-data in ProFTPd; changing user and group in proftpd.conf doesn't help.

Share This Page