• Home
  • About Us
  • Contact
  • Privacy Policy

LinuxAdmin.io

  • Home
  • Tutorials
    • System Administration
    • Linux Tutorials
    • Web Hosting
    • WordPress
    • Virtualization
    • Troubleshooting
    • OpenStack

Install And Configure ProFTPD On CentOS

ProFTPD Installation

ProFTPd is an Open source FTP daemon, widely used for its granular configuration ability.  This is a guide to provide install methods for both CentOS 7 aswell as CentOS 6 and below.  You can read more about ProFTPD on the project’s website.

Install ProFTPD

ProFTPD is in the EPEL repository, you will need to install that first:

yum -y install epel-release

Run a yum update to ensure everything is up to date

yum -y update

Install ProFTPD

yum -y install proftpd

Configure ProFTPD

nano /etc/proftpd.conf

Change the server name:

ServerName "ProFTPD server"

To your servers hostname. Go ahead and save the file afterwards.

Enable and Start Proftpd

Go ahead and restart the service and enable it.

On CentOS 7:

Restart the service:

systemctl restart proftpd

Make sure the service will start after a reboot:

systemctl enable proftpd

On CentOS 6(and below):

Restart the service:

service proftpd restart

Make sure the service will start on reboot:

chkconfig --add proftpd
chkconfig proftpd on

Enable FTP in the firewall

If you are currently using a firewall, you will need to allow incoming FTP connections.

Firewalld

Allow the port for incoming:

firewall-cmd --permanent --add-port=21/tcp

then reload the firewall:

firewall-cmd-reload

Iptables

Add the new rule:

iptables -A INPUT -p tcp -m tcp --dport 20:21 -j ACCEPT

Save the new firewall ruleset:

iptables-save > /etc/sysconfig/iptables

 

Enabling passive connections in ProFTPD

Passive mode can sometimes resolve certain clients ability to connect to the FTP server which may have been blocked by firewalls. If you are having issues connecting remotely,  would like you to try to to enable passive connections in ProFTPD you will need to edit /etc/proftpd.conf

nano /etc/proftpd.conf

And add the following lines:

PassivePorts 60000 65535
 AllowStoreRestart on
 AllowRetrieveRestart on
 TimeoutNoTransfer 65535
 ListOptions "-la"
 TimeoutIdle 65535

You will then also need to add the passive range in the firewall

Iptables:

Add the new rule:

iptables -A INPUT -p tcp -m tcp --dport 60000:65535 -j ACCEPT

Save the ruleset:

iptables-save > /etc/sysconfig/iptables

Firewalld:

Add the new port range:

firewall-cmd --permanent --add-port=60000-65535/tcp

Reload the firewall:

firewall-cmd-reload

 

Testing The FTP Service

You can test the FTP configuration locally first to ensure the daemon is running by using netstat

# netstat -plan|grep :21
tcp6 0 0 :::21 :::* LISTEN 22089/proftpd: (acc

You can also connect locally by installing the ftp client

yum install -y ftp

And then making a connection to the localhost or 127.0.0.1

# ftp localhost
Trying ::1...
Connected to localhost (::1).
220 FTP Server ready.
Name (localhost:root):

 

And enter and valid username and password and it should authenticate. If it does not let you in, the authentication messages are written to /var/log/secure.

Jul 17, 2017LinuxAdmin.io
0 0 vote
Article Rating
Bash Scripting IntroductionHow To Install Memcached on CentOS
You Might Also Like
 
Nginx Caching for WordPress using fastcgi_cache
 
MySQL Replication Master Slave Setup
Subscribe
Notify of
guest
guest
4 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
George
George
4 years ago

Hello, this is very nice and clean. I can connect on my local box, but from another VM I cannot run commands in passive mode. If I ls it says “227 Entering Passive Mode (10, 0, 2, 15, 248, 125) \n ftp:connect:Connection Refused”

I’m not sure why it’s attempting to connect to 248,125 but it’s weird.

0
Reply
LinuxAdmin.io
Author
LinuxAdmin.io
4 years ago
Reply to  George

It works locally in passive mode? Did you open the range in the firewall?

0
Reply
Cliff Williams
Cliff Williams
4 years ago

Well, I read and read the proftpd.org web site and never got my mind around this. Tried installing fro source and verious configurations all to no avail. Had to delete the VM and start over. Then I found your tutorial. It could not have been made any easier.

Thank you!

0
Reply
LinuxAdmin.io
Author
LinuxAdmin.io
4 years ago
Reply to  Cliff Williams

That’s great news!

0
Reply
5 years ago 4 Comments Linux System Administration, Linux Tutorials centos, linux4,275
Recent Posts
  • Laravel Installation Guide For CentOS
  • Openstack Services Explanation And Overview
  • OSSEC Intrusion Detection Installation On Centos 7
  • Configure ProFTPd for SFTP on CentOS
  • How To Check And Repair MyISAM Tables In MySQL
Most Commented
Hot Clone Linux Server with Rsync
Hot Clone A CentOS Server With Rsync
14 Comments
ngx_cache_purge module
Install The ngx_cache_purge Module In Nginx
8 Comments
piwik-nginx
Piwik Analytics on Nginx
8 Comments
Tags
linuxcentosLinux Performance Tuningsysadminkvmnetworkingmemcachedanalyticssystemd
About

We love Linux and are dedicated to creating Linux administration tutorials for System Administrators since 2016.

Most Viewed
Default Gateway
How To Configure A Default Gateway on CentOS
62,977 views
Zend Opcache
Setup and Optimize Zend OpCache
46,714 views
Install ffmpeg
FFMpeg Install On CentOS 7
20,909 views
Archives
Email subscription

Sign up for our newsletter to receive the latest news and event postings.

2018 © LinuxAdmin.io
wpDiscuz