Install vsftpdyuminstall-yvsftpd to edit the ftp configuration file vi/etc/vsftpd. sources = NO # anonymous_enable = YESchroot_local_user = YES # Remove the preceding comment # chroot_list_enable = Y
yum install -y vsftpd
- Edit ftp configuration file
Vi/etc/vsftpd. confanonymous_enable = NO # anonymous_enable = YESchroot_local_user = YES # remove the comment # chroot_list_enable = YES # chroot_list_file =/etc/vsftpd/chroot_list # unrestricted user list, OKallow_writeable_chroot = YES # this line solves the problem of login failure.
service vsftpd startservice vsftpd restart
chkconfig vsftpd on
- Firewall configuration (iptables)
vi /etc/sysconfig/iptables-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
Firewall restart
Create an ftp account
useradd -d /path/you/want -s /sbin/nologin ftpadmin
passwd ftpadmin
chown -R ftpadmin.ftpadmin /path/you/set