Generally, code and files are uploaded to the server, and vsftp is used a lot. The following describes how to install the configuration. Linux: centos6.6. installation Step 1. Install using yum...
Installation Step 1. Use yum to install vsftpd
[root@localhost ~]# yum -y install vsftpd
2. Set to boot
[root@localhost ~]# chkconfig vsftpd on
3. Remove the following comments to make the configuration take effect:
Local_enable = YESwrite_enable = YESlocal_umask = 022chroot_local_user = YES # in this line, you may need to write pam_service_name = vsftpduserlist_enable = YES
4. After saving the configuration, restart the vsftpd service:
[root@localhost ~]# service vsftpd restart
Add users and additional configurations 1. Set vsftp accounts.
[Root @ localhost ~] # Useradd-d/home/htdocs-s/sbin/nologin Username
2. Set a password for the added account
[Root @ localhost ~] # Passwd user name follow the prompts
In this case, the basic vsftpd service is configured. However, after the configuration is complete, the client cannot be connected. The main reason is that the CentOS firewall does not enable the ftp service under the default firewall settings, you must add a module and open port 21 to provide ftp access. 1. Add ip_conntrack_ftp Module
[root@localhost ~]# vi /etc/sysconfig/iptables-config
Add the following line
IPTABLES_MODULES="ip_conntrack_ftp"
2. Open Port 21
[root@localhost ~]# vi /etc/sysconfig/iptables
Add-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
3. Restart iptables to make the new rule take effect.
[root@localhost ~]# service iptables restart
At this point, it should be okay. If error 503 occurs during the software test connection, it should be a problem set by selinux: You can use the followingCommandCheck
[Root @ localhost ~] # Getsebool-a | grep upload -- offallow_ftpd_full_access -- allow -- disable -- offftp_home_dir -- offftpd_connect_db -- offftpd_disable_trans -- offftpd_is_daemon -- disable -- offThis is a problem with selinux. We only need to enable the value of ftp_home_dir to on:, and enable allow_ftpd_full_access.
Top: 0px; margin-bottom: 1.5em; line-height: 1.5em; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; border: 1px solid rgba (0, 0, 0, 0.14902); overflow-y: auto; background-color: rgb (246,246,246); ">
[root@localhost ~]#setsebool -P ftp_home_dir 1 [root@localhost ~]#setsebool -P allow_ftpd_full_access 1