1
Installing the VSFTPD component
after installation, there is a /etc/vsftpd/vsftpd.conf file, which is the vsftp configuration file.
[Email protected] ~]# yum-y install VSFTPD
2
Add an ftp user
This user is used to log on to the FTP server.
[Email protected] ~]# Useradd Ftpuser
Such a user built, you can use this login, remember to use ordinary login do not use Anonymous. The default path after logging in is /home/ftpuser.
3
Add a password to the FTP user.
[Email protected] ~]# passwd Ftpuser
Enter the password two times and then change the password.
4
Firewall Open port
because the FTP default port is a, and the CentOS default is not open, so to modify the iptables File
[Email protected] ~]# Vim/etc/sysconfig/iptables
On The line there is a 22-j ACCEPT below the next line of input is similar to that row, just to Change the, and then:Wq saved.
also run , restart iptables
[Email protected] ~]# service iptables restart
5
Modify selinux
outside the network can be accessed up, but found unable to return to the directory (using FTP active mode, passive mode is still inaccessible), also cannot upload, because selinux Mischief.
Modify selinux:
Execute the following command to view the status:
[Email protected] ~]# Getsebool-a | grep FTP
Allow_ftpd_anon_write--off
Allow_ftpd_full_access--off
Allow_ftpd_use_cifs--off
Allow_ftpd_use_nfs--off
Ftp_home_dir--off
ftpd_connect_db--off
Ftpd_use_passive_mode--off
Httpd_enable_ftp_server--off
Tftp_anon_write--off
[Email protected] ~]#
execute the above command, and then return the result to see that both lines are off, representing, no open extranet access
[Email protected] ~]# setsebool-p allow_ftpd_full_access on
[Email protected] ~]# setsebool-p Ftp_home_dir on
This should be no problem (if, or not, see If the FTP client tool with the Passive mode access, such as the hint entering Passive mode, is Passive mode, the default is not, because the FTP Passive mode is blocked by iptables, the following will talk about how to open, if you do not bother to open, see if you have the client FTP port mode options, or the passive mode option to remove. If the client is still not working, see if the host computer on the client has a firewall turned on.
FileZilla Active, Passive mode modification:
Menu: Edit → settings
6
Turn off anonymous access
To modify the/etc/vsftpd/vsftpd.conf file:
To restart the FTP service:
[Email protected] ~]# service vsftpd restart
7
turn on Passive mode
the default is on, but to specify a port range, open the vsftpd.conf file, and add the following
pasv_min_port=30000
pasv_max_port=30999
indicates that the port range is 30000~30999, this can be changed arbitrarily. Restart the vsftpd after the change.
because this port range is specified,the Iptables also opens the range accordingly, so open the iptables file as above.
also on the next line on the other, more that line, just to change to 30000:30999, and then : Wq Save, restart the next iptables . So it's done.
8
set boot vsftpd ftp service
[[Email protected]~]# chkconfig vsftpd on
Linux Installation VSFTPD components