The establishment of FTP server in Linux and the establishment of linuxftp
The CentOs6.8 installed on vmware12 enables Windows 10 on the physical machine to normally access the FTP server on CentOs.
1. Check whether ftp-related installation packages are installed.
# Rpm-qa | grep vsftpd // The ftp installation package is vsftpd
Check that no related package is installed in my system, so first package the installation.
# Yum-y install vsftpd // If the yum source is not configured here, You can directly install it using rpm.
Check whether the installation is successful.
2. Start the service and set Automatic startup.
# Service vsftpd start // start the service
# Chkconfig -- level 35 vsftpd on // set auto-start
# Chkconfig -- list vsftpd // check whether the setting is successful
3. Configure the vsftpd File
The ftp server has three configuration files in the/etc/vsftpd directory:
Ftpusers // specifies which users cannot access the ftp server
User_list // whether users in this file can log on to the server depends on the options userlist_enable and userlist_deny In the vsftpd. conf file.
Vsftpd. conf // master configuration file of the ftp server
Iv. 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 (by default, the previous '#' is removed)
This allows anonymous users to upload and download files.
5. Access by non-Anonymous Users
1. modify the configuration file
# Vi/etc/vsftpd/vsftp. conf
Disable Anonymous user access first: anon_upload_enable = NO
Add userlist_enable = YES, userlist_file =/etc/vsftpd. user_list, userlist_deny = NO at the end of the configuration file.
(For more information, see the configuration file)
2. Create a user
3. Test it here and log on directly using ftp1. It is found that the logon fails.
4. Put the user ftp into the/etc/vsftpd. user_list file.
# Vi/etc/vsftpd. user_list
Write ftp1 to the file (one row represents a user), save and exit, and reload the service (# service vsftpd reload ).
Access again. If you use ftp1, you can log on to the ftp server.