0

I want to install Pure-FTPd and configure FTP server for transfer files. How can I do this? I am using Ubuntu 13.04.

  • Apparently PureFTPd is peculiar in it's configuration method, any reason you need it in particular? In any case, the Ubuntu help site has a guide: help.ubuntu.com/community/PureFTP – zymhan Aug 14 '13 at 4:55
3

Install Pure-FTPd

root@www:~# aptitude -y install pure-ftpd

run as a daemon

root@www:~# echo "yes" > /etc/pure-ftpd/conf/Daemonize

prohibit Anonymous

root@www:~# echo "yes" > /etc/pure-ftpd/conf/NoAnonymous

enable chroot

root@www:~# echo "yes" > /etc/pure-ftpd/conf/ChrootEveryone

only IPV4

root@www:~# echo "yes" > /etc/pure-ftpd/conf/IPV4Only
root@www:~# /etc/init.d/pure-ftpd restart
Restarting ftp server: Running: /usr/sbin/pure-ftpd -l pam -E -A -8 UTF-8 -B -O clf:/var/log/pure-ftpd/transfer.log -u 1000 -4 -B
0

I developed a guide to installation of PureFTP, MySQL and TLS on Xenial since I had some difficulties, maybe it will help.

http://ajoliveira.com/ajoliveira/uk/software/pure-ftpd-mysql.php

or in Portuguese

http://ajoliveira.com/ajoliveira/pt/software/pure-ftpd-mysql.php

The reason I installed PureFTP is explained in the guide I published, too many problems with proftpd, which became unusable after Trusty (passive mode, TLS) and had problems before (crashes). I found this package easy to install and working with no apparent flaws.

I used ProFTPd for a long time. However on the previus Ubuntu LTS (Trusty) ProFTPd was already buggy, shutting down by itself, which I corrected with a script.

On Xenial the situation become worse, with the product stopping but not shutting down. On the other end I could never setup ProFTPd for passive ftp transfers and TLS never worked properly since MLSD command failed with TLS authentication.

So, I decided to give PureFTP a try. I had to search for information on many different sites since the main site has no information on the obscure files used in the configuration directory. Those are transcriptions of the command-line options with a distinct syntax.

I found out that the installation is straightforward and repeatable when you know the steps to take and the product works like a charm, so I decided to share the installation process with the community.

I assume you will use phpMyAdmin in what MySQK operations are concerned and are familiar with it, so I will be providing an sql file for the single needed database, and assume InnoDB or other transactional engine. If you are using MyISAM, just comment the last sentence on the provided mysql.conf(MySQLTransactions On). All bash commands must be preceded with sudo or you may start a root session with su.

  1. Install the software.

    sudo apt-get install pure-ftpd-mysql
    
  2. Setup user and group.

    sudo groupadd -g 2001 ftpgroup  
    sudo useradd -u 2001 -s /bin/false -d /bin/null -c "pureftpd user" -g ftpgroup ftpuser
    
  3. Setup the database.

    Now using phpmyadmin on the server tab create an user called pureftpd, note the password you choose and click on "Create database with same name and grant all privileges.".

    Load this file and unpack it.

    On the left-pane go to the pureftpd database just created and click on "Import". Select the file you just unpacked. You should end up with a populated database with a single table where:

    • User is the user name
    • status is 0 inactive 1 active
    • Password is the password, encrypted in MD5 (choose MD5 after you enter the password on the varchar(64) dropdown. Change the password on the test user provided or it will never work
    • uid and gid will be 2001 (created on steps above)
    • dir should point to the dir where you have the files. Either that dir is set to be owned by the user/group created (chown ftpuser.ftpgroup "dir") or you might just add ftpuser to your www-data group if we are talking about apache-served files.
    • ULBandwidth and DLBandidth are the limits in kb/s for the upload/download maximum bandwidths, 0 means no limit.
    • comment should serve your internal purposes for user identification.
    • QuotaSize is the maximum space an user is allowed to upload.
    • QuotaFiles is the maximum number of files an user is allowed to upload.

    sudo cp /etc/pure-ftpd/db/mysql.conf /etc/pure-ftpd/db/mysql.conf.old  
    
  4. Configure PureFTP.

    Load this file and unpack it.
    Copy the mysql.conf inside the db directory to /etc/pure-ftpd/db/

    Please change the string my_password on the mysql.conf file, MYSQLPassword field, to the password you defined when you created the user with mysqladmin

    Load this file and unpack it.
    Copy all files inside the conf directory to /etc/pure-ftpd/conf/

    It is assumed in these files that passive ports are 50000-50010 (PassivePortRange), no passive mode forcing (no ForcePassiveIP file, if you want that create one and leave your IP there in a single line), no automatic creation of user home directory (CreateHomeDir), no name resolution (DontResolve), no display of hidden files (DisplayDotFiles), no local user authentication (PAMAuthentication). I increased the maximum number of files per folder and the maximum directory depth (LimitRecursion) to 5000/50. If you want to change those refer to the documentation.

    sudo aptitude install openssl
    
  5. Install ssl certificate.

    sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem chmod /etc/ssl/private/pure-ftpd.pem
    

    -days 3650 will create you a certificate for 10 years...

    sudo chmod /etc/ssl/private/pure-ftpd.pem
    
  6. Putting it to work

    sudo service pure-ftpd-mysql restart
    

Well, it should work...

Installation of the above is entirely at your risk.

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review – ravery Jan 11 '18 at 0:10
  • I see you did it already and I agree, nevertheless link will stay there, page is up for 14 years now. The advantage of link answers is that when you want to make a correction, there is just one place to go. – Antonio J. de Oliveira Jan 11 '18 at 9:19
  • The imported text contains different wording than the original, I spotted at least a different word (MySQK instead of MySQL), I do recommend potential readers to read the original. – Antonio J. de Oliveira Jan 11 '18 at 9:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.