Source: http://www.servermom.com/how-to-install-pure-ftpd-on-centos-6-4/789/
How to Install Pure-FTPd On CentOS 6.4
What is Pure-FTPd?
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.Why Pure-FTPd?
Because it is actively supported, and it was always designed with security in mind, and the code is always re-audited as new kind of vulnerabilities are discussed.
Are there any other alternatives?
Yes there are. Try Pro-FTPd and vsftpd (how to install vsftpd).
How to Install Pure-FTPd on CentOS 6?
The guide is below. But first, read some prerequisites:What You’ll Need?
- A Linux server running CentOS 6. In this guide I use CentOS 6.4 x64 by DigitalOcean.
- You better firstly setup LAMP or LNMP on it.
- You’ll also need an FTP client like FileZilla installed on your computer. This is for testing purpose (and you’ll really need this once you build your site)
- A skill to use SSH and basic Unix commands (I’m sure you have this already).
- About 15 minutes of your time
A. Installing Pure-FTPd Software on CentOS Server
Step 1 – Login to your server and follow my previous guide about Basic setup for CentOS before you build a live web server. You may and may not follow that tutorial but if you followed, it will give you some basic security tweak to your server.Before you proceed to the next steps, it is better to explain that all commands in this tutorial are written without the “sudo” prefix. However if you disabled root login and you logged in using another username with root privilege, you can add the “sudo” prefix all by your self. Alternatively you can simply type su, hit Enter and type in your password twice to switch login as root.
You may also need to type this command to go to the root directory:
1
| cd ~ |
1
| rpm -- import /etc/pki/rpm-gpg/RPM-GPG-KEY * |
1
| rpm -- import http: //dag .wieers.com /rpm/packages/RPM-GPG-KEY .dag.txt |
1
2
3
| cd /tmp wget http: //pkgs .repoforge.org /rpmforge-release/rpmforge-release-0 .5.2-2.el6.rf.x86_64.rpm rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm |
This repo will also give you more benefit:
1
| rpm -- import https: //fedoraproject .org /static/0608B895 .txt |
1
2
| wget http: //dl .fedoraproject.org /pub/epel/6/x86_64/epel-release-6-8 .noarch.rpm rpm -ivh epel-release-6-8.noarch.rpm |
1
| yum update |
Step 3 – Now install Pure-FTPd via yum using this command:
1
| yum install pure-ftpd |
B. Configuring Pure-FTPd (post install)
Step 1 – Go to Pure-FTPd config folder:
1
| cd /etc/pure-ftpd/ |
"pure-ftpd.conf": (in this example I use Nano editor).
1
| nano -w pure-ftpd.conf |
3.1. Look for #UnixAuthentication and uncomment that line (remove the # symbol):
3.2. Then change No in VerboseLog to yes.
3.3. Uncomment the PureDB line:
3.4. Uncomment the CreateHomeDir line
Step 4 – Now create ftp user or aka virtual user used to login to your server. And the command syntax is:
1
| pure-pw useradd ftpuser -u user -g group -d /var/www/domain .com /public_html |
- ftpuser is username you can use it to login to your server via ftp.
- user is a Unix user. If you didn’t created one yet, you can also use root.
- group is a Unix group. If you didn’t created one yet, you can also use root.
- /var/www/domain.com/public_html is default document root folder of your site. This is where the ftp user will have access to once logged in.
1
| pure-pw useradd servermom -u sawiyati -g sawiyati -d /var/www/servermom .com /public_html |
Step 5 – Finally, issue this command:
1
| pure-pw mkdb |
C. Using FTP to Access Your Server
Step 1 – Once you’ve done making some adjustments to pure-ftpd configuration, now you better firstly restart the ftp service:
1
| service pure-ftpd restart |
Don’t panic if you see [FAILED] message in when the system tried to stop pure-ftpd. It happens because pure-ftpd service is not yet started. The point here is the [OK] message when starting.
Step 2 – Now open up your favorite ftp client like FileZilla then enter the detail:
- Host : Enter your server’s IP or hostname (if you’ve added A record to it in your DNS).
- Username : Use what you defined in step 4 section B above.
- Password : Use what you defined in step 5 section B above.
- Port : use Port 21
Step 3 – You’ll finally see the “Status:Directory listing successful” message indicating you are now logged in.
That’s it. I’m sure you knew what you have to do from here. Enjoy..
Optional
Issue this command to make sure pure-ftpd service will be automatically started every time your server reboot:
1
| chkconfig --levels 235 pure-ftpd on |
1
| pure-pw mkdb |