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

 

Was this answer helpful? 0 Users Found This Useful (0 Votes)