Pure-FTPd is a free (BSD), secure, production-quality and standard-conformant FTP server. It doesn’t provide useless bells and whistles, but focuses on efficiency and ease of use. It provides simple answers to common needs, plus unique useful features for personal users as well as hosting providers. In this article, I’ll show you How do I install Pure-FTPd on CentOS 6.3 via yum command.
Install the extra repositories
The first step requires downloading some RPM files that contain the additional YUM repository definitions.
# rpm -Uvh http://mirror-fpt-telecom.fpt.net/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
Sample output
Retrieving http://mirror-fpt-telecom.fpt.net/fedora/epel/6/i386/epel-release-6-8.noarch.rpm Preparing... ########################################### [100%] package epel-release-6-8.noarch is already installed
Installing Pure-FTPd
To install pure-ftpd type the following command
# yum install pure-ftpd -y
Sample output
Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package pure-ftpd.x86_64 0:1.0.36-1.el6.rf will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: pure-ftpd x86_64 1.0.36-1.el6.rf rpmforge 446 k Transaction Summary ================================================================================ Install 1 Package(s) Total download size: 446 k Installed size: 1.4 M Downloading Packages: pure-ftpd-1.0.36-1.el6.rf.x86_64.rpm | 446 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : pure-ftpd-1.0.36-1.el6.rf.x86_64 1/1 Verifying : pure-ftpd-1.0.36-1.el6.rf.x86_64 1/1 Installed: pure-ftpd.x86_64 0:1.0.36-1.el6.rf Complete!
Configuring the Pure-FTPd server
Type the following command to edit Pure-FTPd configuration file
# vi /etc/pure-ftpd/pure-ftpd.conf
Make sure you have these options enabled
# If you want simple Unix (/etc/passwd) authentication, uncomment this UnixAuthentication yes
To secure Pure-FTPd, make sure follow these options
# Cage in every user in his home directory ChrootEveryone yes # If you want to log all client commands, set this to "yes". # This directive can be duplicated to also log server responses. VerboseLog yes # Disallow anonymous connections. Only allow authenticated users. NoAnonymous yes
Turn on and save pure-ftpd
Type the following two commands to turn on pure-ftpd:
# chkconfig pure-ftpd on # service pure-ftpd start
Iptables open FTP Port 21 and 20
FTP server use both port 21 and 20 (port 21 for the command port and port 20 for the data). To open two port 20 & 21 on Iptables let’s do step by step.
The first, type the following command to load two iptables modules
# modprobe ip_conntrack # modprobe ip_conntrack_ftp
Type the following commands to add the iptables rules for incoming request on port 20 & 21
# iptables -A INPUT -p tcp -m tcp --dport 20 -j ACCEPT # iptables -A INPUT -p tcp -m tcp --dport 21 -j ACCEPT