1, installation vsftpd
# Yum Update source
# yum Install vsftpd-y installing VSFTPD server
2, Configuration vsftpd.
# vi/etc/vsftpd/vsftpd.conf Configuration vsftpd master configuration file
Find the following item change or Open #
Anonymous_enable=no Prohibit anonymous access
#ascii_upload_enable allow uploading using ASCII code
#ascii_download_enable allow the use of ASCII code to download
Chroot_list_enable=yes restrict access to directories outside the home directory for FTP users
Chroot_list_file=/etc/vsftpd/chroot_list restrict FTP users from accessing directories outside the home directory user list:
Add the following code at the end to turn on passive mode and better support for FTP tools such as FlashFXP
Pasv_enable=yes
pasv_min_port=20000 #开放的端口
pasv_max_port=20100
Note: Add a sentence at the end of the Local_root=/install will enter this directory, no matter what user login FTP. It seems that the first time the user login will enter the/home/user name directory. After rebooting, we're in the/install directory.
3, configure the firewall, open 21 and other ports
The firewall is configured in/etc/sysconfig/iptables, but centos6x does not have this file. First generate this file
1) Run a iptables firewall rule configuration command at any one:
# iptables-p OUTPUT ACCEPT
2) Save the Iptables service
# Service Iptables Save
3) Restart Iptables service
# Service Iptables Restart
After these three steps,/etc/sysconfig/iptables exists. Then do the following:
# Vi/etc/sysconfig/iptables
Add the following two lines above [commit]
-A input-m state--state new-m tcp-p TCP--dport 21-j ACCEPT open 21 port
-A Input-p TCP--dport 20000:20100-j ACCEPT development Port 20000-20100:
4. Restart the firewall and start the VSFTPD server
Restart Firewall: #service iptables restart
Restart the VSFTPD server: #service vsftpd Start (note that if the VSFTPD is already started, then booting is a failure.) Can be switched off and then restarted)
5. Add FTP User
# adduser-g Ftp-s/sbin/nologin Zhangtao added Zhangtao FTP user
# passwd Zhangtao Set password for Zhangtao
6. Write the added user to Vim/etc/vsftpd/chroot_list
Zhangtao
Can
When you're done, you can access it with FLASHFXP. The directory after landing is/home/zhangtao