.
3ss.cn

怎么在centos7下搭建ftp服务器

1、安装vsftpd这款ftp服务器软件,命令如下:

yum install -y vsftpd

2、设置vsftpd服务开机自启动,然后重启服务,查看ftp服务端口,命令如下:

#chkconfig vsftpd on
#systemctl enabled  vsftpd.service
#systemctl restart vsftpd.service
#netstat -antup|grep ftp

安装完成后需要重启vsftpd服务。

3、编辑vsftpd主配置文件/etc/vsftpd/vsftpd.conf

修改anonymous_enable = NO,这样可以禁止匿名登录。

去掉chroot_local_user = yes前的注释,限制用户访问家目录之外的地方。

4、创建ftp用户,设置用户无法登录服务器系统并且家目录在/var/www/html下

5、给其他人修改文件夹的权限:chmod o+w /var/www/html/

6、关掉selinux

vi /etc/selinux/config

重启系统。

在系统内部尝试自己访问, ftp ip地址,应该能成功登陆,继续配置外网访问

7、关闭防火墙

systemctl stop firewalld.service
赞(0)
未经允许不得转载:互联学术 » 怎么在centos7下搭建ftp服务器

评论 抢沙发