CentOs6.8 installed on vmware12 finally enabled Windows 10 on the physical machine to access the FTP server on CentOs normally.
1. Check whether the ftp related installation package is installed.
# rpm -qa | grep vsftpd //The installation package of ftp is vsftpd
I found that there are no related packages installed in my system, so first Package the installation.
# yum -y install vsftpd //If the yum source is not configured here, you can install it directly using rpm. The same is true
Check whether it is installed Success
2. Start the service and set it to start automatically at boot.
# service vsftpd start //Start the service
chkconfig --level 35 vsftpd on //Set up auto-start
# chkconfig --list vsftpd //Check whether the setting is successful
3. Configure the vsftpd file
The ftp server mainly has three configuration files, all located in /etc/vsftpd Directory:
ftpusers // Used to specify which users cannot access the ftp server
user_list // Whether users in this file can log in to the server depends on userlist_enable in the vsftpd.conf file and userlist_deny these two options.
vsftpd.conf //The main configuration file of the ftp server
4. Anonymous user access
Open vsftpd.conf
# vi /etc/vsftpd/vsftp.conf
Set these two options to YES: anon_upload_enable=YES and anon_mkdir_write_enable=YES (generally they already exist by default, just remove the '#' in front)
This enables anonymous users to upload and download files. ps: Detailed explanation of the configuration file
5. Access by non-anonymous users
1. Modify the configuration file
# vi /etc/vsftpd/vsftp.conf
First turn off anonymous user access: anon_upload_enable=NO
Add at the end of the configuration file: userlist_enable=YES, userlist_file =/etc/vsftpd/vsftpd.user_list, userlist_deny=NO
(If you don’t know the specific meaning, please refer to the configuration file for details)
2. Create a user
3. Let’s test it here first. Log in directly using ftp1, and find that you can’t log in.
4. Put the user ftp into the /etc/vsftpd/vsftpd.user_list file.
# vi /etc/vsftpd/vsftpd.user_list
Write ftp1 in the file (one line represents one user), then save and exit, and reload the service (# service vsftpd reload).
Visit again and use the ftp1 user to log in to the ftp server.
Ps: If you don’t understand some of the options in the vsftpd.conf configuration file, you can read the detailed description of the file!
The above is the detailed content of Steps to build FTP server in Linux. For more information, please follow other related articles on the PHP Chinese website!