If there is no FTP, the site upload download files will be very troublesome, so FTP is necessary to build a station tool. We use the virtual host, has default to provide FTP services, and provide FTP account management interface, etc., we only need to create users on it, but the cloud host needs to build their own FTP environment and create FTP users, so that in their own computer with FTP client upload or download files.
Although the CentOS operating system installation of FTP is not as convenient as the Windows operating system graphical interface operation, but the use of commands is also easy to build the FTP environment, the following is the sky-wing cloud host to build an FTP server, and configure the use of FTP client connections detailed tutorial.
This article uses VSFTPD as an FTP server, and 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. Here we describe how to install and configure VSFTPD on CentOS systems.
First, install VSFTPD in CentOS
Log in with root in Putty, and then execute the following command
The code is as follows |
Copy Code |
Yum Install vsftpd |
Set up automatic boot
The code is as follows |
Copy Code |
Chkconfig vsftpd on |
Start the VSFTPD service
The code is as follows |
Copy Code |
Service VSFTPD Start |
Second, configure VSFTPD
Executive: vi/etc/vsftpd/vsftpd.conf
Delete the # in front of the following lines if there is no # then stay the same
The code is as follows |
Copy Code |
Local_enable=yes Write_enable=yes local_umask=022 Chroot_local_user=yes #这行如果没有, add a row yourself Pam_service_name=vsftpd Userlist_enable=yes |
After saving, restart the VSFTPD service,
The code is as follows |
Copy Code |
Service VSFTPD Restart |
Third, add FTP users
Add user Ftpuser, point to Directory/home/wwwroot/ftpuser, and disable login SSH permissions
The code is as follows |
Copy Code |
useradd-d/home/wwwroot/ftpuser-g ftp-s/sbin/nologin ftpuser |
Modify password
The code is as follows |
Copy Code |
passwd Ftpuser |
The directory Write permissions to the FTP user, otherwise upload file
The code is as follows |
Copy Code |
Chown-r Ftpuser/home/wwwroot/ftpuser |
Four, configure the firewall, open 21 ports
If you do not open port 21, the client is not connected.
Execute the following command sequentially
The code is as follows |
Copy Code |
Iptables-a input-p tcp-m state–state new-m tcp–dport 21-j ACCEPT /etc/rc.d/init.d/iptables Save Service Iptables Restart |
At this point, completed the Sky Wing Cloud host FTP Service installation and configuration, the use of FTP clients such as FileZilla can be connected to your sky-wing cloud host upload download files. (After the configuration needs to wait a period of time to use the client connection, the author just installed the dead and dead are not connected, did not make any changes to the situation the next day can be connected, if you are also encountered at the beginning of the situation, please wait a while to try again.) )