1. Install VSFTPD. (Ps:procedure 1-4 under the circumstance that the firewall are closed and the iptables is inactive)
1 Install vsftpd 2 sudo Yum Install vsftpd 3 # start VSFTPD 4 sudo systemctl start Vsftpd.service 5 # start automatic after rebooting
2.configurations about VSFTPD.
1 sudovim/etc/vsftpd/vsftpd.conf2 3# # #The following key-values is specially listed####4anonymous_enable=NO5dirmessage_enable=YES6local_umask=0227xferlog_enable=YES8Ftpd_banner="Welcome Messages"9data_connection_timeout= -Ten One # restart VSFTPD service A sudoSystemctl Restart Vsftpd.service
3.create FTP User
1 sudo useradd-s/sbin/nologin netlab2sudopasswd netlab3 sudochmod777 /home/Netlab
4.limit the user to the root directory
# Revise the configuration of vsftpd sudo vim/etc/vsftpd/vsftpd.conf#### #Special items########## #chroot_local_user=yeschroot_ List_enable=yeschroot_list_file=/etc/vsftpd/chroot_listallow_writeable_chroot= file . Otherwise, it would be wrong. sudo Touch /etc/vsftpd/chroot_list# Restart the servicesudo systemctl restart Vsftpd.service
5.about the Firewall
Open the port to allow the application the port.
e.g.,
-A input-m state–state new-m tcp-p tcp–dport 21-j ACCEPT
CENTOS-FTP Server