How to Setup SFTP Server in CentOS 7

 

In this post we will see, how to install Secure FTP Server in CentOS 7 distribution:

Image Source - ipswitch.com


Step 1:

Install FTP Package (Package Name is vsftpd)
yum install vsftpd ftp -y
The location of ftp folder is /var/ftp/pub


Step 2:

After installation of vsftpd open the configuration file of vsftpd and make some change given below -
vim /etc/vsftpd/vsftpd.conf

Edit some line

Disable anonymous_enable=YES to NO

Un-comment the line 
ascii_upload_enable=YES
ascii_download_enable=YES

If you want, you can add the welcome message to un-comment ftpd_banner=Welcome to blah FTP service

And, add a line at the bottom of the file
#
use_localtime=YES

Save and Exit the file



Step 3:

Enable VSFTP on boot mode and Start the service

Allow the ftp port on firewall

firewall-cmd —permanent - -add-port=21/tcp
firewall-cmd —permanent - -add-service=ftp
firewall-cmd - -reload

Disable SELinux boolean for FTP Service

setsebool -P ftp_home_dir on


Finally, Enable the VSFTPD service and boot mode and start the service

systemctl enable vsftpd
systemctl start vsftpd


Popular posts from this blog

Firewalld Command - Useful firewall-cmd Examples (RHEL based)

How to Convert PEM KeyFile into PPK KeyFile and vice versa?