Installing and Configuring Pure-FTPd on Ubuntu

At the time of writing, I will be doing a test installation on Ubuntu Server 14.04.3 LTS.

First, install pure-ftpd by typing:

sudo apt-get install pure-ftpd

Create a user and a group from which our FTP server will work:

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

Create a directory for storing virtual user files:

sudo mkdir /home/ftpuser/
sudo chown -R ftpuser:ftpgroup /home/ftpuser

We activate the use of virtual users:

sudo ln -s /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/50pure

I will give an example of creating the first virtual user, for example, with the name test:

sudo mkdir /home/ftpuser/test
sudo chown -R ftpuser:ftpgroup /home/ftpuser/test
sudo pure-pw useradd test -u ftpuser -d /home/ftpuser/test

To allow the user to go beyond the specified directory, use the “-D /home/ftpuser/test” parameter.

A complete list of possible parameters can be seen by typing the command:

man pure-pw

View user information:

sudo pure-pw show USERNAME

Password change example:

sudo pure-pw passwd USERNAME -m

Update user settings:

sudo pure-pw usermod USERNAME OPTIONS -m

Delete user:

sudo pure-pw userdel USERNAME -m

View a list of existing users:

sudo pure-pw list

View user activity:

sudo pure-ftpwho

We apply the changes made by the command below or restart pure-ftpd:

sudo pure-pw mkdb
sudo service pure-ftpd restart

You can disconnect everyone from the server with the command:

sudo killall pure-ftpd

You can stop/start the server like this:

sudo service pure-ftpd stop
sudo service pure-ftpd start

The configuration files will be located in the directory /etc/pure-ftpd/conf/, with each parameter in a separate file, they can be edited with any text editor.

To change the port, for example, you need to create a Bind file in the directory /etc/pure-ftpd/conf/ and specify in it the port number or IP:PORT on which Pure-FTPd should work.
To prevent disk overflow, you can create a MaxDiskUsage file and specify for example 70 in it to block data transfer if the disk is more than 70% full.

See also my articles:
IPTables rules for FTP server
Active and passive FTP mode
Installing and Configuring ProFTPd in Ubuntu

Leave a comment

Leave a Reply

Discover more from IT Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading