Centos7 安装ftp服务躺过的坑

切记关闭selinux,网上相关说和他有问题的,都是扯淡。

1.安装vsftpd

# yum check-update
# yum -y install vsftpd

2.配置参数

# vi /etc/vsftpd/vsftpd.conf

 修改为如下参数

anonymous_enable=NO
chroot_local_user=YES
--添加如下参数 allow_writeable_chroot=YES pasv_enable=YES pasv_min_port=40000 pasv_max_port=40100

3.重启ftp

# systemctl restart vsftpd.service
# systemctl enable vsftpd.service

4.修改防火墙配置

   # systemctl start firewalld.service

# firewall-cmd --permanent --add-service=ftp
# firewall-cmd --reload

5.为ftp创建一个用户test1(指定目录为/home/www,不允许远程登录shell)

# useradd -d /home/www -m test1 -s /sbin/nologin
# cd /home/www
# chmod -R 777 *

6.为ftp用户设置一个密码

# passwd test1

然后关闭服务器防火墙

systemctl disable firewalld.service
原文地址:https://www.cnblogs.com/dreamli/p/8057198.html