Install the VSFTP service under CentOS6.3

  • 2020-05-12 06:43:37
  • OfStack

Detailed steps for installing FTP server under CentOS:

Step 1, check that FTP: [root @localhost centos]# rpm-q vsftpd has been installed on the server side

If it appears: [root @localhost centos]# package vsftpd not installed, vsftpd has not been installed. If it appears: vsftpd-2.2.2-13.el6_6.1.i686, vsftpd has been installed.

Step 2, install vsftpd. [root @localhost centos]# yum-y install vsftpd server side FTP installation in the super administrator role.

Step 3, set the anonymous login FTP information.

1. Shut down the firewall on the server side

2 allows an exception to port 21 [root@localhost centos]# vi /etc/sysconfig/iptables] to be added to the walls of the document


-A INPUT -m state  � state NEW -m tcp -p tap  � dport 21 -j ACCEPT
-A INPUT -p tcp  � dport 30000:30100 -j ACCEPT

Restart vsftpd service [root @localhost centos

4. Enable the firewall on the server side

In step 4, the above operation enables the anonymous login of vsftpd.

Step 5: cancel the anonymous login mode of vsftpd on the server side, and add the user authentication login mode again.

1. shut down anonymous login methods. [root @ localhost centos] # vi/etc/vsftpd/vsftpd conf

anonymous_enable=YES: anonymous_enable=NO. Set to disable anonymous login

2. let the vsftpd server support the passive link mode by adding the following at the end of the configuration file:


pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES 
pasv_enable=YES
pasv_max_port=30100
pasv_min_port=30000

3. restart vsftpd server [root @localhost centos]# service vsftpd restart

Step 6: add vsftp server-side user authentication to login.

(1) to modify the configuration file, and add user authentication: [root @ localhost centos] # vi/etc/vsftpd/vsftpd conf

Restrict users to their own directories,


chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd/chroot_list

The article adds vsftpd to verify the user's login name and password


[root@localhost centos]# useradd -d /var/www/php -g ftp -s /sbin/nologin sniper
[root@localhost centos]# passwd sniper

Improving directory permissions


[root@localhost centos]# chmod 777 /var/www/php -R

Below, assign directory permissions to sniper users in the FTP group


[root@localhost centos]# chown sniper:ftp /var/www/php

5. Restart vsftpd service [root @localhost centos

To sum up, VSFTPD has been configured and installed.

If the ftp client connection FTP server error: 500 OOPS: could not read chroot () list file: / etc/vsftpd/chroot_list, you need to amend the chroot_list_enable = YES into: chroot_list_enable=NO, restart the test.

The completed installation of VSFTPD does not support ftp file upload and download, view list and other functions, so you need to enter another two lines of commands to set:


[root@localhost www]# setsebool -P ftp_home_dir 1
[root@localhost www]# setsebool -P allow_ftpd_full_access 1

Related articles: