Wednesday, June 1, 2011

Configuring pure-ftpd with Authorised User access on SUSE Linux

  1. Install the pure-ftpd package
    zypper in pure-ftpd

  2. Edit the /etc/pure-ftpd/pure-ftpd.conf file and modify and save the following directives with the values stated:
    ChrootEveryone YES
    Demonize YES

    AnonymousOnly NO

    NoAnonymos YES
    PureDB /etc/pure-ftpd/pureftpd.pdb #(This line needs to be uncommented)


  3. Create a UNIX dummy user account and a home directory for an authorised user
    • Create a UNIX dummy account
      useradd -s /dev/null ftpduser


    • Create a chrooted ftp home directory for the authorised user (it can be anywhere on the system - just get the UNIX file permission/ownership correct)
      mkdir /srv/ftp/ftpduser

      chown -R ftpduser /srv/ftp/ftpduser


  4. Creating and associating pure-ftpd virtual user account (we call it jim) to UNIX system account
    pure-pw useradd jim -u ftpduser -d /srv/ftp/ftpduser

    • Then update the /etc/pure-ftpd/pureftpd.pdb database
      pure-pw mkdb
      (required for each time user added/removed/modified)

    * You may associate multiple virtual user accounts to one UNIX user account. All virtual user accounts will use the local permissions permissible to the UNIX user account.

    * You may also do a one-to-one matching i.e. one virtual account to one UNIX account - but you may need to create multiple home directories.


  5. Restart the pure-ftpd daemon and you are good to go. Ensure that the appropriate firewall port is opened.

No comments: