0. first install ftp service yuminstall-yftp1. install vsftp2via yuminstall-yvsftp. modify vi/etc/vsftpd. conf and open chroot_list_enabled = yes, chroot_list_file =/etc/vsftpd/chroot_list
0. first install the ftp service
Yum install-y ftp
1. install vsftp through yum install-y vsftp
2. modify vi/etc/vsftpd. conf, enable chroot_list_enabled = yes, and enable chroot_list_file =/etc/vsftpd/chroot_list.
Then touch/etc/vsftpd/chroot_list to add the user
3. create an ftp User:
Useradd-d/home/ftp-g ftp-s/sbin/nologin ftptest
Passwd ftptest
4. firewall needs to be configured
Open the/etc/sysconfig/iptables file
Vi/etc/sysconfig/iptables
Add the following code before the REJECT line:
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 21-j ACCEPT
Then restart the firewall. because the CentOS firewall command has been changed to firewalld, the command has been changed:
Service firewalld start/restart/stop
5. authorize chmod 777/home/ftp/* to/home/ftp /*
Cancel the root directory permission chmod a-w/home/ftp
PS: disable the SELinux method
# Vi/etc/selinux/config
Set SELINUX = XXX --> XXX to the level
Change
SELINUX = disabled