vsftpd安装命令-CentOS 6

1、准备工做

1.安装vsftpd
yum install vsftpd
2.添加用户并设置密码
useradd ftpuser
passwd ftpuser 复制代码

2、修改配置文件

3.ftp默认走的21端口,须要打开
vim /etc/sysconfig/iptables
4.修改配置文件后重启防火墙iptables服务
service iptables restart
5.selinux中配置
getsebool -a | grep ftp //若是不报SELinux is disabled就执行下面两行
setsebool -P allow_ftpd_full_access on // 外部是否能够经过ftp协议访问
setsebool -P ftp_home_dir on // 咱们是否能够访问ftp对应的文件夹
    注意,若是出现了getsebool:  SELinux is disabled,须要修改一下他的配置文件并重启,须要必定时间
    vim /etc/selinux/config
    reboot // 可能须要一下子才能够进入
6.关闭匿名访问
vim /etc/vsftpd/vsftpd.conf // 进入配置文件(在里面修改YES为NO)
service vsftpd restart // 修改配置文件后重启服务
7.开启被动模式
打开 vsftpd.conf 文件 ,指定端口范围。记得iptables中也要开启对应
vim /etc/vsftpd/vsftpd.conf // 在该配置文件最后面加上下面两句
pasv_min_port=30000
pasv_max_port=30999
service vsftpd restart // 重启服务
vim /etc/sysconfig/iptables // 修改配置段偶
service iptables restart // 重启服务
8.设置服务开机启动
chkconfig vsftpd复制代码

至此vsftpd安装完成
相关文章
相关标签/搜索