CentOS 7 FTP服务配置

来源:互联网 发布:初音未来眼药水 淘宝 编辑:程序博客网 时间:2024/05/18 03:36
记录下在CentOS 7系统下配置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用户即可登录。