---Note: The following collation of the more chaotic.
Installing VSFTPD
1. Execute the following command as Administrator (root)
Yum Install vsftpd
2. Set Boot VSFTPD FTP service
Chkconfig vsftpd on
3. Start VSFTPD Service
---------------can use anonymous access to FTP at this time----------------
Service VSFTPD Start
Manage VSFTPD Related commands:
Stop Vsftpd:service vsftpd Stop
Restart Vsftpd:service vsftpd Restart
Configuring firewalls
Open/etc/sysconfig/iptables File
Vi/etc/sysconfig/iptables
Add the following code before reject line
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 21-j ACCEPT
Save and close files, restart firewall
Service Iptables Start
-------------------The above code is supposed to open port 21, I'm not using it here-----------------
4. Configuring the 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 User
Here is the Add Ftpuser user, set the root directory to/home/wwwroot/ftpuser, prevent this user from logging on to SSH, and restrict access to other directories.
1, modify the/etc/vsftpd/vsftpd.conf
Put the bottom three lines
#chroot_list_enable =yes
# (default follows)
#chroot_list_file =/etc/vsftpd/chroot_list
Instead (remove the comment)
Chroot_list_enable=yes
# (default follows)
Chroot_list_file=/etc/vsftpd/chroot_list
Prohibit anonymous user access:
Anonymous_enable=yes, change YES to No
At the end of the file, add the following settings:
pasv_enable=yes; Allow passive mode
pasv_min_port=10000; passive mode using port range
pasv_max_port=10010
local_max_rate=200000: User broadband limit (not tested)
chroot_ Local_user=yes: No User left home directory (not tested)
Note: After setting up the PASV port, you need to modify the firewall, as in CentOS, modify the following:
iptables-a rh-firewall-1-input-p TCP--dport 10000:10010-j ACCEPT
5, add user Ftpuser, point to directory/home/wwwroot/ftpuser, Disable login SSH permissions.
useradd-d/home/wwwroot/ftpuser-g ftp-s/sbin/nologin ftpuser
6. Set User password
passwd Ftpuser (Ftpuser)
7. Edit File Chroot_list:
Vi/etc/vsftpd/chroot_list
The content is an FTP user name, one row per user, such as:
Jlins
John
6. Restart VSFTPD
Service VSFTPD Restart
------------------------------------------
This time using VSFTPD vsftpd error:
Error: Disconnected from server
Error: Connection failed
Status: Waiting for retry ... (will also retry 20 times)
Error: Connection failed
Error: interrupted by user!
Status: Connecting 10.187.216.28 ...
Status: Already connected to 10.187.216.28:0. Waiting for welcome info ...
Response: (VsFTPd 2.2.2)
Command: USER ftpuser
Response: 331 Specify the password.
Command: PASS *******
Response: Oops:cannot Change Directory:/home/wwwroot/ftpuser
Error: Connection failed
----------------------------
However, client Access prompts for the following error:
Oops:cannot Change Directory:/home/ftp
The reason for this is that his CentOS system has SELinux installed because the default is no FTP-enabled support, so access is blocked.
------------------------here is another way to solve this--------------------
To the online check, is the SELinux configuration problem, two methods to solve:
1, Setsebool-p Ftp_home_dir on after delivery service vsftpd restart
Or Setsebool-p Ftpd_disable_trans on after delivery service vsftpd restart also line
2. Turn off SELinux
Modify the/etc/selinux/config file or/etc/syscofnig/selinux settings selinux= disabled, and then restart
Specific Run command
[Email protected] wwwroot]# setsebool-p ftp_home_dir on
[Email protected] wwwroot]# service vsftpd Restart
The 550 Create directory operation failed appears again after the------------configuration is complete above. (In the course of the modification, the service iptables was shut down if necessary to restart)
Here's how to fix it
First step, Configure 777 permissions for the directory
Step two, turn off the SELinux method
# Vi/etc/selinux/config
The Selinux=xxx-->xxx represents the level
Switch
Selinux=disabled
Reboot is OK! (note; The restart here is to restart the server!!!!!)
If you do not want to restart the server, you can use the following command:
Setenforce 0
Then restart the VSFTPD
Original address: http://www.itmmd.com/201410/72.html
The article is published by the Android Development and distribution, reproduced must be marked by the source. .
CentOS 6 Installation Vsftp detailed steps, CentOS 6 vsftp Problem Summary