CentOS搭建FTP服务器


1.安装vsftpd
yum install vsftpd

2.编辑iptables
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21
service iptables restart

3.配置vsftpd
vi /etc/vsftpd/vsftpd.conf
anonymous_enable=NO //设定不允许匿名用户访问。

4.添加ftp用户
vi /etc/vsftpd/vsftpd.conf
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list

5.添加ftp用户home目录
useradd -d /var/www/html -g ftp -s /sbin/nologin test

6.设置用户密码
passwd test

7.修改权限
chmod 777 /var/www/html -R
chown test:ftp /var/www/html

8.启动vsftpd
service vsftpd restart

OK!搞定,使用test用户即可登录。

相关内容