1. Install vsftp
1.1. Install vsftp, the version of vsftpd installed for testing is: vsftpd.x86_64 0:3.0.2-11.el7_2
yum -y install vsftpd
1.2, modify the configuration file
vi /etc/vsftpd/vsftpd.conf
Make sure the following 3 items are YES
anonymous_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
1.3. Set vsftpd to start at boot
systemctl enable vsftpd.service
1.4. Start and view the status of the vsftpd service. If systemctl starts the service successfully, there will be no prompt. The green active indicates that the service is running.
systemctl start vsftpd.service
systemctl status vsftpd.service
2. Locally verify whether ftp can be accessed normally
2.1, install ftp
yum -y install ftp
2.2. Use anonymous login without password
ftp localhost
220 means that the service is normal and you can log in; 230 means that the login is successful.
2.3. View FTP server folder information
3. Whether the external certificate ftp can be accessed normally
3.1. Turn off the firewall (you can also set firewall rules, you have to Baidu again)
systemctl stop firewalld.service
To prevent the firewall service from re-opening after the machine restarts, you can permanently close the firewall service.
systemctl disable firewalld.service
3.2. Enter ftp://IP address on the window, you can see the directory under ftp (pub is preset by the system)
4. File reading and writing.
So far, we found that files cannot be read and written in the ftp directory, which is caused by folder permissions and selinux.
4.1, set the folder permissions, set the permissions of the pub folder to 777
chmod 777 -R /var/ftp/pub
4.1, close the selinux service
vi /etc/selinux/config
Change SELINUX=enforcing to: SELINUX=disabled
4.3. Restart the system to make the configuration take effect
shutdown -r now
4.4, upload files
At this point, ftp is completely installed. If you need to configure user permissions for FTP, you can Baidu.
1. Install vsftp
1.1. Install vsftp, the version of vsftpd installed for testing is: vsftpd.x86_64 0:3.0.2-11.el7_2
yum -y install vsftpd
1.2, modify the configuration file
vi /etc/vsftpd/vsftpd.conf
Make sure the following 3 items are YES
anonymous_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
1.3. Set vsftpd to start at boot
systemctl enable vsftpd.service
1.4. Start and view the status of the vsftpd service. If systemctl starts the service successfully, there will be no prompt. The green active indicates that the service is running.
systemctl start vsftpd.service
systemctl status vsftpd.service
2. Locally verify whether ftp can be accessed normally
2.1, install ftp
yum -y install ftp
2.2. Use anonymous login without password
ftp localhost
220 means that the service is normal and you can log in; 230 means that the login is successful.
2.3. View FTP server folder information
3. Whether the external certificate ftp can be accessed normally
3.1. Turn off the firewall (you can also set firewall rules, you have to Baidu again)
systemctl stop firewalld.service
To prevent the firewall service from re-opening after the machine restarts, you can permanently close the firewall service.
systemctl disable firewalld.service
3.2. Enter ftp://IP address on the window, you can see the directory under ftp (pub is preset by the system)
4. File reading and writing.
So far, we found that files cannot be read and written in the ftp directory, which is caused by folder permissions and selinux.
4.1, set the folder permissions, set the permissions of the pub folder to 777
chmod 777 -R /var/ftp/pub
4.1, close the selinux service
vi /etc/selinux/config
Change SELINUX=enforcing to: SELINUX=disabled
4.3. Restart the system to make the configuration take effect
shutdown -r now
4.4, upload files
At this point, ftp is completely installed. If you need to configure user permissions for FTP, you can Baidu.