Install and configure PureFTPd Server on Linux

Home > Search
  by

To install PureFTPd in Linux, enter the following commands in the Linux Terminal. If using a Red Hat version of Linux (CentOS / RHEL), replace apt-get with yum. Also, if using CentOS, you will need to update:

http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-7.noarch.rpm

apt-get install pure-ftpd

This command is used to install PureFTPd.


groupadd ftpgroup

This created a group named ftpgroup.


usermod –a –G ftpgroup wendy

This adds the user "wendy" to the ftpgroup.


cat /etc/groups | grep ftpgroup

For reassurance that wendy was added to the ftpgroup, we can view the /etc/group file.


mkdir /home/ftpusers

This creates a directory named ftpusers.


mkdir /home/ftpusers/jeremy

This creates a directory named jeremy.  Of course, you can use a different username.


pure-pw useradd wendy -u ftpuser -d /home/ftpusers/wendy

This creates a user account named jeremy to PureFTPd, and sets the directory for the user account. If using CentOS, you need to use the uid and gid, such as: pure-pw useradd wendy -u 1000 -g 1001 -d /home/ftpusers/wendy


pure-pw mkdb

This creates the pureftpd.passwd database.


ln -s /etc/pure-ftpd/pureftpd.passwd /etc/pureftpd.passwd

This creates a symbolic link between /etc/pure-ftpd/pureftpd.passwd and /etc/pureftpd.passwd.  


ln -s /etc/pure-ftpd/pureftpd.pdb /etc/pureftpd.pdb

This creates a symbolic link between /etc/pure-ftpd/pureftpd.pdb and /etc/pureftpd.pdb.


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

This creates a symbolic link between /etc/pure-fptd/PureDB and /etc/pure-ftpd/auth/PureDB.


chown -hR root:ftpgroup /home/ftpusers/

This recursively changes the ownership of /home/ftpusers/.  The owner is root and the group owner is ftpgroup.


service pure-ftpd restart

This restarts the PureFTPd service.


service pure-ftpd status

Let's make sure pure-ftpd is active and running.

Optional: Pureadmin can also be installed using apt-get or yum if we want to administer PureFTPd using the Pureadmin GUI application.

apt-get install Pureadmin
yum install Pureadmin

 

In order for computers to be able to connect to our FTP Server:

  • Routers in LAN will need to forward traffic on port 21 to the private IP address of the computer in our LAN that is running PureFTPd. Nmap can be used to verify if port 21 is open.
  • The iptables firewall will need to allow traffic on port 21.

 

If some problem occurs, for which you need to completely uninstall Pure-FTPd, use these commands.

apt-get remove --auto-remove pure-ftpd-common
apt-get purge pure-ftpd-common

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments