Tag: pureftpd

  • Install Pure-FTPd from source

    To instal pureftpd from source, go to

    http://download.pureftpd.org/pub/pure-ftpd/releases/

    find latest version download link.

    Download and Install

    At the time of this post, latest version is 1.0.49, always use latest version when you are installing.

    cd /usr/local/src
    wget https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.49.tar.gz
    tar -zxvf pure-ftpd-1.0.49.tar.gz
    cd pure-ftpd-1.0.*
    ./configure --with-puredb
    make
    make check
    make install
    

    The software is now installed in /usr/local/sbin/pure-ftpd

    To start the server, just run the following command

    /usr/local/sbin/pure-ftpd
    

    Common Errors during install

    If you get error: no acceptable C compiler found in $PATH, install gcc with

    yum install gcc -y
    

    Firewall

    FTP need following ports open in firewall.

    TCP 21
    TCP 30000-50000
    

    Enable MySQL support

    If you need to enable MySQL support in pure-ftpd, then run configure command with following option.

    ./configure --with-mysql --with-uploadscript --with-extauth
    

    Configuration Files

    During installation, configuration file get copied to

    /etc/pure-ftpd.conf
    

    You can edit it as required.

    To start pure-ftpd with configuration file, run

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

    To enable system users login, set UnixAuthentication to yes.

    UnixAuthentication            yes
    MinUID                      100
    

    MinUID specify lowest id of users that is allowed to login to user. You can uncomment it if you need user root or any other system users to login. But this maybe insecure as FTP comminication is done with out encryption.

    NAT

    If you are behind NAT, you need to uncomment following settings. This is required for most cloud providers like Amazon AWS, Google Cloud, Microsoft Azure. To see if you have NAT, see if your Public IP is configured inside your server. You can list IP configured in your server with command ip a

    PassivePortRange             30000 50000
    ForcePassiveIP               192.168.0.1
    

    Replace 192.168.0.1 with your public IP. If you are using Amazon AWS, then it will be your Elastic IP address. If you don’t use Elastic IP, then it is your public IP.

    See PureFTPd

  • Install Pure-FTPd on CentOS with Virtual Users

    To install Pure-FTPd on CentOS, run

    yum install -y pure-ftpd
    

    Edit configuration file

    vi /etc/pure-ftpd/pure-ftpd.conf
    

    To disable anonymous FTP, find

    NoAnonymous                  no
    

    Replace with

    NoAnonymous                  yes
    

    To enable Virtual Users, find

    # PureDB                        /etc/pure-ftpd/pureftpd.pdb
    

    Uncomment the line.

    PureDB                        /etc/pure-ftpd/pureftpd.pdb
    

    To Allow Apache user to login via FTP, find

    MinUID                      1000
    

    Replace with

    MinUID                      47
    

    I set MinUID value to 47, as apache user have UID/GID of 48. By setting MinUID below that apache user should be able to login.

    Set pureftpd to start on Boot

    systemctl enable pure-ftpd
    

    Restart pure-ftpd

    systemctl start pure-ftpd
    

    Create a Virual User

    To create a virtual user, run

    pure-pw useradd  USER_NAME_HERE -u apache -g apache -d /var/www/html/
    

    It will ask you to enter password two times.

    Now run

    pure-pw mkdb
    systemctl restart pure-ftpd
    

    Change Password of an existing Virual User

    pure-pw passwd USER_NAME_HERE
    

    It will ask you to enter new password.

    Rebuild password database and restart pure-ftpd with

    pure-pw mkdb
    systemctl restart pure-ftpd
    

    Related Posts

    Install pureftpd on Ubuntu

    pureftpd

  • Pure-FTPd

    To install Pureftpd on CentOS, run

    yum install pure-ftpd
    

    To start/stop, use

    systemctl start pure-ftpd
    systemctl stop pure-ftpd
    

    To enable system users to login, edit /etc/pure-ftpd/pure-ftpd.conf, un comment the line UnixAuthentication yes.