I want to install Pure-FTPd and configure FTP server for transfer files. How can I do this? I am using Ubuntu 13.04.
2 Answers
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
- 36,350
- 46
- 4
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
sudoor you may start a root session withsu.
Install the software.
sudo apt-get install pure-ftpd-mysqlSetup user and group.
sudo groupadd -g 2001 ftpgroup sudo useradd -u 2001 -s /bin/false -d /bin/null -c "pureftpd user" -g ftpgroup ftpuserSetup 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 is0 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.oldConfigure 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 opensslInstall 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.pemPutting it to work
sudo service pure-ftpd-mysql restartWell, it should work...
Installation of the above is entirely at your risk.
- 122,292
- 133
- 301
- 332