First, the foregoing
Linux in the Enterprise to build FTP server is still very practical, so this article for CENTOOS7 and CENTOOS6 build Server tutorial to do a summary.
Second, the specific
1. The display indicates that the VSFTP software is installed. If it does not appear, you need to install the VSFTPD software.
If not, install through the Yarm source
Yum Install-y vsftpd
2. After the installation is complete
Access to the root directory of the FTP is configured by default in the /etc/vsftpd/ file
/ETC/VSFTPD/VSFTPD.CONF:VSFTPD's core configuration file
/etc/vsftpd/ftpusers: Used to specify which users cannot access the FTP server. blacklist
/etc/vsftpd/user_list: Specifies the user list file that is allowed to use VSFTPD. White list
/etc/vsftpd/chroot_list: Specifies the user list file that is allowed to use VSFTPD. directory under the control list can not leave the FTP root directory
The vsftpd.conf is configured as follows:
Anonymous_enable=no #允许匿名用户访问为了安全选择关闭
Local_enable=yes # Allow local users to log on
Write_enable=yes # Whether to allow write
local_umask=022 # umask for local users to upload files
Dirmessage_enable=yes the contents of the #为YES则进入目录时显示此目录下由message_file选项指定的文本文件 (, by default,. Message)
Xferlog_enable=yes #开启日志
Xferlog_std_format=yes #标准格式
Connect_from_port_20=yes
Xferlog_file=/var/log/xferlog #ftp日志目录
idle_session_timeout=6000 #设置客户端连接时间
data_connection_timeout=1200 #设置数据连接时间 for upload, download
Chroot_list_enable=yes
chroot_list_file=/etc/vsftpd/chroot_list #设置为YES则下面的控制有效
Chroot_list_enable=yes#若为NO, the user logged in the file specified by Chroot_list_file (the default is/etc/vsftpd.chroot_list) will be chroot in the directory where it was logged in and cannot leave. If yes, The logged user will not be chroot. Here is yes.
Chroot_local_user=yes
users in the Userlist_deny=no #若设置为YES则记录在userlist_file选项指定文件 (by default,/etc/vsftpd.user_list) will not be able to login and will be prosecuting the following userlist _deny Options
Userlist_enable=yes#若为NO, only the login request of the user logged in the userlist_file option specified file (by default,/etc/vsftpd.user_list) is accepted. If yes, these user requests are not accepted.
userlist_file=/etc/vsftpd/user_list #白名单
Chroot_list_enable=yes
local_root=/var/ftp/pub #根目录
Listen=yes
pam_service_name=vsftpd
Userlist_enable=yes
Tcp_wrappers=yes
3. Create a whitelist useradd xxx passwd xxx and add to User_list and chroot_list
4. Turn off the firewall
Centoos 7 operation for Systemctl stop Firewalld.service
Centoos 6 Operation bit service stop iptables;
5. Start the FTP server
Cetoos 7 operation for/bin/systemctl restart Vsftpd.service
Centoos 6 operation for service vsftpd restart
6. Empowering, assigning the root directory specified by FTP to 777 permissions
chmod 777/var/ftp/pub
7. Check the SELinux status and close
Getsebool-a|grep FTP
If Centoos7 to this end with FTP tool can be accessed or local FTP server tested via RPM-IVH rpm. Install the installation package for the FTP client configuration.
If Centoos 6 is setting several permissions:
By:setsebool httpd_enable_ftp_server 1 is set to the following state. View via getsebool-a|grep ftp .
To build Success!!!!
Linux---The Construction of FTP server