Installing and Configuring Pure-FTPD on CentOS 7
Pure-FTPd is a free (BSD license) FTP Server with a strong focus on software security. It can be compiled and run on a variety of Unix-like computer operating systems including Linux, OpenBSD, NetBSD, FreeBSD, DragonFly BSD, Solaris, Tru64, Darwin, Irix and HP-UX. It has also been ported to Android.
Install Pure-FTPD
You can directly install Pure-FTPD using yum command:
yum install pure-ftpd
– Configuring Pure-FTPd
The configuration files for pure-ftpd are located in the file /etc/pure-ftpd/pure-ftpd.conf
. So the first thing we’re going to do is to edit it using the command:
vi /etc/pure-ftpd/pure-ftpd.conf
And modify the following:
- Comment the line
PAMAuthentication yes
- Enable the PureDB functionality by uncomment the line
PureDB
- Change the value for
NoAnonymous
toyes
– Start Pure-FTPd as a service
To start Pure-FTPd, use the command:
systemctl start pure-ftpd
Then, enable the Pure-FTPd service:
systemctl enable pure-ftpd
Create a new ftp user account
In order to create FTP user account “virtual user” we need to walk through the following steps:
– Adding a “Default” User and Group
For smooth functioning, Pure-FTPd requires you to create a default user and group with no special permissions or even a password. We’re going to call this “pureftpuser” and “pureftpgroup.” Here are the commands:
Create a default group:
groupadd pureftpgroup
Create a default user:
useradd -g pureftpgroup pureftpuser
Now we have a user called “pureftpuser” belonging to the group “pureftpgroup.”
– Create virtual user
- To create a virtual user, we only need a name for that virtual user like testftpuser.
- Assigned this virtual user to the “pureftpuser” system account we created earlier.
- And, assign a folder like “/home/www/domain.com” as their root directory.
pure-pw useradd testftpuser -u pureftpuser -d /home/www/domain.com
You’ll be asked for a password, and it’s confirmation.
– Set the folder permission
Make sure the folder is created, and give our user/group ownership permissions:
chown -R pureftpuser.pureftpgroup /home/www/domain.com
– Rebuild the puredb
Once the virtual user has been created, we need to rebuild the puredb using the following command:
pure-pw mkdb
– Access the FTP account
you can access your new FTP account using the following:
- Host: your_up_address
- UserName: testftpuser
- Password: testftpuser_password
Tag:FTP Server, Puer-FTPD