centos7 vsftp的安装

拈花ヽ惹草 提交于 2019-11-26 14:49:00

首先下载vsftp

yum install -y vsftpd

安装好了之后 编辑默认的文件

vi /etc/vsftpd/vsftpd.conf

更改下面的:

anonymous_enable=NO
#anonymous_enable=YES

chroot_local_user=YES
#去掉前面的注释

#chroot_list_enable=YES
#chroot_list_file=/etc/vsftpd/chroot_list
#不受限制的用户列表,用不用都OK

allow_writeable_chroot=YES
#加上这行解决了无法登陆的问题

重启:

service vsftpd start
service vsftpd restart

设置开机启动

chkconfig vsftpd on

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

# useradd -d /home/www -m test1 -s /sbin/nologin

设置密码:

# passwd test1

添加21端口

firewall-cmd --zone=public --add-port=21/tcp --permanent

加载下防火墙

firewall-cmd --reload

查看当前启动的端口

firewall-cmd --zone=public --list-all

如果需要删除端口的话,命令为

firewall-cmd --permanent --zone=public --remove-port=21/tcp
firewall-cmd --permanent --zone=public --remove-port=21/udp

 

 

 

参考:http://www.cnblogs.com/milton/p/5560003.html

   http://www.centoscn.com/image-text/install/2015/0227/4748.html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!