Guide for Installing Pure-FTPd and Creating Virtual Users

Category : Advanced

Hey Zappers,

Bored of managing files over WebUI and want some change? So, we have a good choice for a change.

We will show how you can install FTP Server on your VPS or Dedicated Machine using Pure-FTPd tool. We will also show you how you can create Virtual Users for FTP Service that can be accessed by you over FTP. Using Virtual Users makes sure that it doesn’t create any conflicts with Unix Users or can be said as Real Users. There are few prerequisites for performing entire tasks to achieve success.

Requirements

  • Linux Server with Root
  • SSH Commands Experience

Procedure

Installation and configuration for FTP Server using Pure-FTPd

  1. Login to root via SSH
  2. Create user and group without any privileges and no valid shell.

    groupadd _pure-ftpd
    useradd -g _pure-ftpd -d /var/empty -s /etc _pure-ftpd

    Note- Don’t Use this user and group anywhere for any purpose.

  3. Download Latest Pure-FTPd tar ball according to your CPU Architecture and Distribution

    https://www.pureftpd.org/project/pure-ftpd/download

  4. Extract tar ball using

    tar -xvf *.tar.gz

  5. Prepare source code for installation

    ./configure –with-everything


    –with-everything 
    flag will build a big server with almost all features turned on:
    altlog, cookies, throttling, ratios, ftpwho, upload script, virtual users
    (puredb), quotas, virtual hosts, directory aliases, external authentication,
    Bonjour and privilege separation.

  6. Install prepared binary from source

    make install-strip

  7. Link Pure-FTPd to .conf file in /etc/

    /usr/local/sbin/pure-ftpd /etc/pure-ftpd.conf

  8. We need to make slight configuration changes in pure-ftpd.conf file

    nano /etc/pure-ftpd.conf

  9. Look for #UnixAuthentication and uncomment that line (remove the # symbol)
  10. Uncomment the PureDB line
  11. Uncomment the CreateHomeDir line
  12. Save and exit conf file
  13. Start FTP Server using

    /usr/local/sbin/pure-ftpd &

    ‘&’ is mandatory, please don’t skip it

  14. FTP Server is ready and ready to role. Run following to test

    ftp localhost

  15. We will configure to run FTP Server on boot, add the following line in /etc/rc.d/rc.local or /etc/rc.d/boot.local and don’t forget the ‘&’ sign. Then save and exit.

    /usr/local/sbin/pure-ftpd &

Create Virtual User

  1. Login to root via SSH.
  2. Create user ftpuser and group ftpgroup

    groupadd ftpgroup
    useradd -g ftpgroup -d /dev/null -s /etc ftpuser

  3. For creating FTP user we need to decide in which user and group it goes. We will create basezap FTP user and it will be added in user blogger and group also blogger. Enter Password for created user twice when asked after below command execution.

    pure-pw useradd basezap -u blogger -g blogger -d /home/blogger/public_html/

    /home/blogger/public_html/ is home directory for basezap FTP user.

  4. If you want to convert all system (/etc/passwd) accounts to virtual FTP users

    pure-pwconvert >> /etc/pureftpd.passwd

  5. Update the Database

    pure-pw mkdb

Now you are ready to connect to FTP server and virtual user using your favourite FTP Client.