Original link: http://www.centos.bz/2011/03/centos-install-vsftpd-ftp-server/
VSFTPD, as an FTP server, is very common in Linux systems. Here's how to install Vsftp on a centos system.
What is vsftpd
VSFTPD is one of the most admired FTP server programs in the Linux distribution. The feature is small and brisk, safe and easy to use.
VSFTPD's name stands for "Very secure FTP daemon", and security is one of the top issues considered by its developer Chris Evans. At the beginning of the design and development of this FTP server, high security is a goal. Install VSFTPD
1. Execute the following command as Administrator (root) yum install vsftpd
2, set up boot vsftpd FTP service chkconfig vsftpd on
3, Start vsftpd service vsftpd start
Manage VSFTPD related commands:
Stops Vsftpd:service vsftpd stop
Reboot Vsftpd:service vsftpd Restart Configure firewall
Open/etc/sysconfig/iptables File Vi/etc/sysconfig/iptables
(If you find no iptables this file:
Workaround:
1, casually write a iptables command to configure a firewall rule: such as:
Iptables-p OUTPUT ACCEPT
2, service iptables save for saving)
Add the following code before the Reject line-A rh-firewall-1-input-m State--state new-m tcp-p TCP--dport 21-j ACCEPT
Save and close files, reboot Firewall service iptables start Configure VSFTPD server
The default configuration file is/etc/vsftpd/vsftpd.conf, which you can open with a text editor. vi/etc/vsftpd/vsftpd.conf Add FTP users
The following is the add Ftpuser user, set the root as/home/wwwroot/ftpuser, prohibit this user from logging on to SSH, and restrict access to other directories.
1. Modify/etc/vsftpd/vsftpd.conf
The bottom three lines #chroot_list_enable =yes # (default follows) #chroot_list_file =/etc/vsftpd.chroot_list
Change to Chroot_list_enable=yes # (default follows) Chroot_list_file=/etc/vsftpd/chroot_list
3, increase user Ftpuser, point to directory/home/wwwroot/ftpuser, prohibit login SSH permission. useradd-d/home/wwwroot/ftpuser-g ftp-s/sbin/nologin ftpuser
4, set user password passwd ftpuser
5. Edit file chroot_list: vi/etc/vsftpd/chroot_list
Content is an FTP user name, one row for each user, such as:
Peter
John
6, restart VSFTPD service vsftpd restart
In addition, if you find it troublesome to manage your FTP username later, you can use the CentOS official release script management. The address is as follows:
the error that occurred in Http://wiki.centos.org/HowTos/Chroot_Vsftpd_with_non-system_users
1 Oops:cannot Change Directory
Workaround:
In the terminal input command: setsebool-p Ftpd_disable_trans 1 service vsftpd restart
It's OK.
Reason: This is because the server has SELinux enabled, which limits the ftp login.