centos build ftp server details and a brief introduction

  • 2020-05-24 06:39:41
  • OfStack

centos sets up the ftp server

1. Install vsftpd

sudo yum install vsftpd

2. Configuration vsftpd. conf



# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO

# When SELinux is enforcing check for SE bool ftp_home_dir
local_enable=YES


write_enable=YES

#  The local ftp Directory address 
local_root=/var/ftp

3. Add ftp users


# Create a user 
adduser -d /var/ftp -g ftp -s /sbin/nologin *_ftp

# Change the password 
passwd *_ftp


4. Upload permission


#  Modify upload path permissions  777   Set permissions based on your preferences 
sudo chmod -R 777 /var/ftp

#  To view  ftp  Set up the 
getsebool -a|grep ftp

ftp_home_dir --> on
ftpd_anon_write --> off
ftpd_connect_all_unreserved --> off
ftpd_connect_db --> off
ftpd_full_access --> on
ftpd_use_cifs --> off
ftpd_use_fusefs --> off
ftpd_use_nfs --> off
ftpd_use_passive_mode --> off
httpd_can_connect_ftp --> off
httpd_enable_ftp_server --> off
sftpd_anon_write --> off
sftpd_enable_homedirs --> off
sftpd_full_access --> off
sftpd_write_ssh_home --> off
tftp_anon_write --> off
tftp_home_dir --> off

#  Modify the ftp_home_dir , ftpd_full_access  for  on
setsebool -P ftp_home_dir=on ftpd_full_access=on

5. Set vsftp to boot

chkconfig vsftpd on

6. Add a firewall

firewall-cmd --permanent --add-service=ftp

firewall-cmd --reload

Thank you for reading, I hope to help you, thank you for your support of this site!


Related articles: