CentOS / RHEL 7 : How to install and configure ftp server (vsftpd)

The FTP service/server is provided by the vsftpd daemon. Very Secure FTP Daemon (vsftpd) is the most secure and fastest FTP server. By default, the vsftp server runs on the port 20 and 21. To configure FTP service on RHEL7, please follow the steps given below.

 

Install and configure vsftpd

 

1. First and foremost install the vsftpd package which provides the FTP service.

# yum -y install vsftpd

 

2. Set the range of ports that can be used by ftp in /etc/vsftpd/vsftpd.conf. (note : by default, it uses passive mode)

pasv_min_port=3000
pasv_max_port=3500

 

Enable the vsftd service

 

Configure the vsftpd service to be started when the system boots:

# systemctl enable vsftpd.service  
# systemctl start vsftpd.service

 

Open the ports in firewalld

 

1. Open the ports that will be uesed by ftp.

# firewall-cmd --add-port=21/tcp --add-port=3000-3500/tcp --permanent

 

2. Restart the firewalld.service for the changes to take effect.

# systemctl restart firewalld.service

 

Configure SELinux for vsftpd

 

If you want to make regular user be able to get files from server and put files to server when SELinux is enforcing, please set the boolean value as below. This is required only when SELinux is in enforcing mode.

# setenforce 1   
# setsebool -P ftpd_full_access 1

 

How to add/modify vsftpd banner?

 

Follow the steps below to add or modify the vsftpd login banner.

1. Add the following line to the file /etc/vsftpd/vsftpd.conf

ftpd_banner=[YOUR BANNER HERE]

 

2. Restart the vsftpd service.

# service vsftpd restart
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How can I configure a ip range in CentOS7?

You have to use a range file Edit /etc/sysconfig/network-scripts/ifcfg-enp0s3 and make...

Adding a Public IPv6 Address to a Linux Server (CentOS 7)

To configure an additional public IPv6 address in CentOS 7, proceed as follows:...

How To Install EPEL Repository On CentOS And RHEL 7

How to install EPEL for Centos 7 [root@localhost ~]# cat  /etc/centos-release CentOS Linux...

Common Commands (CentOS 7)

Basic Configuration Query or System Locale...

Install LAMP Stack on CentOS 7

Install LAMP Stack on CentOS 7 One of the most simple and barebones solutions you can have for...