centos7 vsftp的安装

首先下载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

posted @ 2017-06-05 21:47  大园子  阅读(842)  评论(1编辑  收藏  举报