First, Introduction
VSFTP is a file server software that is often used in file sharing, code updates, and file backups, and the following are the basic installation environments:
1) CentOS6.6
2) vsftpd-2.2.2
Second, installation
$ yum install-y vsftpd
Third, the configuration
$ vi/etc/vsftpd/ vsftpd.conf
listen_address=192.168.19.128 #指定监听地址
Listen_port=21 #指定监听端口
Anonymous_enable=NO #不允许匿名访问local_enable=YES #允许本地用户write_enable=YES #允许上传local_umask=022 #本地用户上传的文件掩码dirmessage_enable=YES #xferlog_enable=YES #开启日志connect_from_port_20=YES #使用20端口连接ftpxferlog_file=/var/log/Xferlog #指定日志文件位置xferlog_std_format=YES #指定日志格式为标准输出chroot_local_user=yes#允许目录跳转chroot_list_enable=YES #允许文件中指定的用户有目录跳转权限chroot_list_file=/etc/vsftpd/chroot_list #在该文件指定可跳转的用户listen=YES #允许指定监听pam_service_name=vsftpd #定义pam模块中的文件名 (the module can not be used, has been replaced by userlist) userlist_enable=YES #允许文件中的用户登录userlist_deny=no #除文件中指定的用户可以登录, the others do not allow Userlist_file=/etc/vsftpd/user_list #在此配置文件指定哪些用户可以登录tcp_wrappers=YES #允许tcp_wrappers防火墙允许和阻止特定的ippasv_enable=YES #运行被动模式pasv_min_port=65400 #分配起始端口Pasv_max_port=65410 #分配结束端口
Four, the operation
-- list vsftpdvsftpd 0:off 1:off 2:on 3:on 4:on 5:on 6: Off /etc/init.d/vsftpd start$ setenforce 0" selinux=disabled " >/etc/selinux/config (restart in effect)
$ iptables-a input-m State--state new-m tcp-p TCP--dport 21-j ACCEPT #开放21端口 20 data ports are automatically turned on
$ iptables-a input-m State--state new-p TCP--dport 65400:65410-j ACCEPT #开放被动模式下的端口
$ useradd caoguo-s/sbin/nologin #建立一个ftp账户
$ echo "Caoguo" |passwd Caoguo--stdin #给账户设置密码
V. Inspection
VI. Customer Upload Test
#安装客户端
$ Yum install-y FTP
#检查服务端是否上传了改文件
Centos6.6 Installing a system-certified VSFTP Service