Installing ProFTPD Server on RHEL/CentOS 7 | TecMint.com

Curated: TecMint.com click below for the original post:

Installing ProFTPD Server on RHEL/CentOS 7

by Matei Cezar | Published: August 25, 2014 | Last Updated: February 14, 2017

Linux Certifications - RHCSA / RHCE Certification | Ansible Automation Certification | LFCS / LFCE Certification

ProFTPD is an Open Source FTP Server and one of the most used, secure and reliable file transfer daemons on Unix environments, due to its file configurations simplicity speed and easy setup.

Install Proftpd In CentOS 7

Install Proftpd In RHEL/CentOS 7

Requirements

  1. CentOS 7 Minimal Installation
  2. Red Hat Enterprise Linux 7 Installation
  3. Configure Static IP Address on System

This tutorial will guide you on how you can install and use ProFTPD Server on CentOS / RHEL 7 Linux distributions for a simple file transfer from your local system accounts to remote systems.

Step 1: Install Proftpd Server

1. Official RHEL/CentOS 7 repositories doesn’t provide any binary package for ProFTPD Server, so you need to add extra package repositories on your system provided by EPEL 7 Repo , using the following command.

rpm -Uvh http://ftp.astral.ro/mirrors/fedora/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm

Install EPEL in CentOS 7

Install EPEL in RHEL/CentOS 7

2. Before you start installing ProFTPD Server, edit your machine hosts file, change it accordingly to your system FQDN and test the configurations to reflect your system domain naming.

nano /etc/hosts

Here add your system FQDN on 127.0.0.1 localhost line like in the following example.

127.0.0.1 server.centos.lan localhost localhost.localdomain

Then edit /etc/hostname file to match the same system FQDN entry like in the screenshots below.

nano /etc/hostname

Open Hostname File

Open Hostname File

Add Hostname in Hosts

Add Hostname in Hosts

3. After you have edited the host files, test your local DNS resolution using the following commands.

hostname # hostname -f ## For FQDN # hostname -s ## For short name

How to Check Hostname in CentOS

Verify System Hostname

4. Now it’s time to install ProFTPD Server on your system and some required ftp utilities that we will be using later by issuing following command.

yum install proftpd proftpd-utils

Install FTP in CentOS

Install Proftpd Server

5. After the server is installed, start and manage Proftpd daemon by issuing the following commands.

systemctl start proftpd # systemctl status proftpd # systemctl stop proftpd # systemctl restart proftpd

Start Proftpd Server

Start Proftpd Server

Step 2: Add Firewall Rules and Access Files

6. Now, your ProDTPD Server runs and listen for connections, but it’s not available for outside connections due to Firewall policy. To enable outside connections make sure you add a rule which opens port 21 , using firewall-cmd system utility.

firewall-cmd –add-service=ftp ## On fly rule # firewall-cmd –add-service=ftp --permanent ## Permanent rule # systemctl restart firewalld.service

Open FTP Port in CentOS

Open Proftp Port in Firewall

7. The most simple way to access your FTP server from remote machines is by using a browser, redirecting to your server IP Address or domain name using ftp protocol on URL.

ftp://domain.tld OR ftp://ipaddress

8. The default configuration on Proftpd Server uses valid system local accounts credentials to login and access your account files which is your $HOME system path account, defined in /etc/passwd file.

Access Proftpd from Browser

Access Proftpd from Browser

Index of Proftpd Files

Index of Proftpd Files

9. To make ProFTPD Server automatically run after system reboot, aka enable it system-wide, issue the following command.

systemctl enable proftpd

That’s it! Now you can access and manage your account files and folders using FTP protocol using whether a browser or other more advanced programs, such as FileZilla, which is available on almost any platforms, or WinSCP, an excellent File Transfer program that runs on Windows based systems.

Suggested Read: How to Install, Configure and Secure FTP Server in CentOS 7

On the next series of tutorials concerning ProFTPD Server on RHEL/CentOS 7, I shall discuss more advanced features like enabling Anonymous account, use TLS encrypted file transfers and adding Virtual Users.

CentOSFTP

How to Setup an FTP Server with ProFTPd on CentOS 7

1 year ago

by Shahriar Shovon

FTP (File Transfer Protocol) is a very popular protocol for file sharing. There are many popular FTP servers out there. ProFTPd is one of them. ProFTPd is a very powerful and easy to configure FTP server software.

In this article, I am going to show you how to install and configure ProFTPd FTP server on CentOS 7. So, let’s get started.

Installing ProFTPd Server:

ProFTPd is available in the EPEL package repository which is not enabled by default. Once you enable EPEL package repository, you can easily install ProFTPd using the YUM package manager.

First, update the YUM package repository cache with the following command:

$ sudo yum makecache

Now, enable the EPEL repository with the following command:

$ sudo yum install epel-release

Now, press y and then press to continue.

YUM may ask you to accept the GPG key of the CentOS repository. To do that, press y and then press .

EPEL repository should be enabled.

Now, update the YUM package repository cache again with the following command:

$ sudo yum makecache

Now, install ProFTPd with the following command:

$ sudo yum install proftpd proftpd-utils

Now, press y and press to confirm.

YUM may ask you to accept the GPG key of the EPEL repository. Just, press y and then press to accept it.

ProFTPd should be installed.

Now, check whether the proftpd service is running with the following command:

$ sudo systemctl status proftpd

As you can see, the proftpd service is not active. So, it’s not running.

To start the proftpd service, run the following command:

$ sudo systemctl start proftpd

As you can, see proftpd service is now running.

$ sudo systemctl status proftpd

Now, open FTP ports in firewalld firewall with the following command:

$ sudo firewall-cmd --zone=public --add-service=ftp --permanent

Now, reload firewalld with the following command for the changes to take effect.

$ sudo firewall-cmd --reload

Accessing The FTP Server:

Now, to test whether the FTP server is working, let’s try to connect to it from an FTP client program such as FileZilla.

First, you have to know the IP address of the FTP server. For that, run the following command on the FTP server.

$ ip a

As you can see, the IP address of my FTP server is 192.168.21.133 . It will be different for you. So, make sure to replace it with yours from now on.

Now, open FileZilla or your preferred FTP client and type in the IP address of your FTP server, your login username and password and the port 21. Once you’re done, click on Connect ( Quickconnect in FileZilla). You should be connected to the FTP server as you can see in the screenshot below.

Automatically Start ProFTPd on System Boot:

Now that ProFTPd FTP server is working just fine, it’s a good idea to add the proftpd service to the system startup so that it will start automatically on system boot.

To add the proftpd service to the system startup, run the following command:

$ sudo systemctl enable proftpd

As you can see, the proftpd service is added to the system startup.

Configuration Files of ProFTPd:

On CentOS 7, the default configuration file of ProFTPd is /etc/proftpd.conf .

The configuration file is well documented. So, you can just use it as a manual as well.

As it contains a lot of comments, it’s hard to see which lines are active and which are not (commented out). So, It’s best to make a backup copy of the original configuration file and remove the comments from the original configuration file. So, whenever you need any help, you can always look at the backup copy.

To make a backup of the /etc/proftpd.conf file, run the following command:

$ sudo cp -v /etc/proftpd.conf /etc/proftpd.conf.backup

Now, remove all the comments from the original configuration file /etc/proftpd.conf with the following command:

$ sudo egrep -v ‘^.*#’ /etc/proftpd.conf | sudo tee /etc/proftpd.conf

This is the original configuration file before all the comments were removed.

This is the original configuration file after all the comments are removed. Looks neat!

Add New Users:

The default configuration of CentOS lets the local system login users to log into the FTP server and upload files to their home directories. So, in order to add a new FTP user, all you have to do is to create a new user on the CentOS 7 server where ProFTPd is installed.

To add a new user linda (let’s say), run the following command:

$ sudo adduser -m linda

Now, set a password for the newly created user linda with the following command:

$ sudo passwd linda

Now, re-type the password and press .

The password should be set.

As you can see, the user linda can connect to the FTP server. No extra configuration required.

Chroot Users into Their Home Directories:

By default, the FTP users can navigate to the root directory as well. Even though they can’t make any changes to files and directories they don’t have permissions to. But, it’s still a bad idea to let them explore the root directory freely.

To lock users to their own home directory, you can simple enable Chroot jail feature of ProFTPd. By default, the CentOS 7 version of ProFTPd has Chroot jail enabled. But, if it is not enabled for you in some case, you can enable it as follows.

To enable chroot jail, first, open the ProFTPd configuration file /etc/proftpd.conf with the following command:

$ sudo vim /etc/proftpd.conf

Now, type in the line as marked in the screenshot below and save the file.

Now, restart the proftpd service with the following command:

$ sudo systemctl restart proftpd

Now, the FTP users will only be able to explore their own home directories

So, that’s how you install and configure ProFTPd FTP server on CentOS 7. Thanks for reading this article.
Shahriar Shovon

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.