www.cnblogs.com/zhi-leaf/p/…
1. Install VSFTP
1.1. Install VSFTP. The VSFTPD version is vsftpd.x86_64 0:3.0.2-11.el7_2
yum -y install vsftpd
Copy the code
1.2. Modify the configuration file
vi /etc/vsftpd/vsftpd.conf
Copy the code
Make sure the following three items are YES
anonymous_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
1.3. Set VSFTPD to start
systemctl enable vsftpd.service
Copy the code
1.4. Start and check the VSFTPD service status. No message is displayed indicating that the VSFTPD service is started successfully
systemctl start vsftpd.service
systemctl status vsftpd.service
Copy the code
2. Verify that FTP is accessible locally
2.1. Install FTP
yum -y install ftp
Copy the code
2.2 login using Anonymous, no password required
ftp localhost
Copy the code
User name: Anonymous
Password: < none >
220 indicates that the service is normal and you can log in. 230 indicates successful login.
2.3. View the FTP server folder information
Exit command: quit
3. Check whether the external FTP can be accessed normally
3.1, close the firewall (can also set firewall rules, baidu again)
systemctl stop firewalld.service
Copy the code
To prevent the firewall service from being restarted, you can disable the firewall service permanently.
systemctl disable firewalld.service
Copy the code
3.2, enter ftp://IP address on window, you can see the directory under FTP (pub is preset for system)
4. File reading and writing.
So far, we have found that files cannot be read or written to FTP directories due to folder permissions and Selinux.
4.1. Set the folder permissions. Set the pub folder permissions to 777
chmod 777 -R /var/ftp/pub
Copy the code
4.1. Stop the Selinux service
vi /etc/selinux/config
Copy the code
Change SELINUX=enforcing to SELINUX=disabled
4.3 Restart the system to make the configuration take effect
shutdown -r now
Copy the code
4.4 upload files
FTP is installed. If you want to configure FTP user rights, you can search for FTP user rights.