How to build FTP server

  
under LINUX

Build ftp server under Linux

• Install vfftpd main server program

Rpm –ivh vsftpd.xxx.rpm

&bull ; Vsftpd three user forms

1, anonymous user form: in the case of the default installation, the system only provides anonymous user access

2, local user form: in /etc/passwd The user name is the authentication method

3. Virtual user form: Supports saving the user name and password in the database file or database server. Compared with the local user form of FTP, the virtual user is only a proprietary user of the FTP server, and the virtual user can only access the resources provided by the FTP server, which greatly enhances the security of the system itself. Compared with anonymous users, virtual users need a username and password to obtain files in the FTP server, which increases the manageability of users and downloads. For users who need to provide download services, but do not want everyone to be able to download anonymously; both need to manage download users, and consider host security and easy to manage FTP sites, virtual users are an excellent solution.

Vsftpd configuration file

/etc/pam.d/vsftpd (used to enhance the authentication of vsftpd server users)

/etc/vsftpd/vsftpd.conf (vsftpd main Configuration file)

/etc/vsftpd/ftpusers (Users located in this file cannot access the vsftpd service)

/etc/vsftpd/user_listThis file is a user that may be rejected. It may also be allowed, depending on user_list=yes or no, the user in the yes list is forbidden to log in.

/var/ftp/pub (download directory)

Vsftpd program

/usr/sbin/vsftpd (vsftpd program)

/etc/rc.d/init.d/vsftpd(startup script)

/etc/pam.d/vsftpd( Pam certification)

############################################################################### Anonymous_enable=YES #Enable anonymous user

no_anon_password=YES #Anonymous user login does not ask for password

The following four main statements control the uploading, downloading, and creation of this file and folder. Delete and rename.

anon_upload_enable=(yes/no); #Control anonymous users upload permissions on files (non-directories).

anon_world_readable_only=(yes/no); #Control anonymous user download permission for files

(Note: set to yes can not download, set no to download)

anon_mkdir_write_enable =(yes/no); #Control anonymous users to create permissions on folders

anon_other_write_enable=(yes/no); #Control anonymous users to delete and rename files and folders

Note: Anonymous user download is using the user nobody, so the corresponding O location must have R permission to be downloaded. If you want anonymous users to be able to upload and delete permissions, you must set

write_enable=YES #global settings, whether to allow writing (whether anonymous or local users, if you want to enable upload permission, you must open him)

anon_root=(none) #anonymous user home directory

anon_umask=(077) #Anonymous user has a mask when uploading files (if the file uploaded by anonymous users can be directly anonymized) Download, set this here as 073)

chown_uploads=YES #The user of all anonymous uploaded files will be changed to chown_username

chown_username=whoever #username of anonymous upload file< Br>

################# Local User Permission Control###############br>

write_enable=YES # can upload (global control) delete, rename

local_umask=022 #local user upload file umask

local_root #Set a local user to log in to the directory

download_enable #Restrict user's download permission

chown_uploads=YES #All anonymous uploaded files will be changed to chown_username

cho Wn_username=whoever #username of the anonymous upload file

user_config_dir=/etc/vsftpd/user_conf/#The directory that stores the configuration file is used to implement different permissions for different users.

vim /etc/vsftpd/user_conf/username #Add the specified directory local_root=/data/www

chroot_list_enable=YES #If you enable this feature, all are listed in chroot_list_file The user cannot change the root directory. The default value is yes.

chroot_list_file=/etc/vsftpd/chroot_list # Indicates the list file of users locked in their home directory.

vim /etc/vsftpd/chroot_list #Write Restricted Username

You can control the user to switch directory through the following three configuration files

by using chroot_local_user=YES/NO Matching can achieve the following effects:


Copyright © Windows knowledge All Rights Reserved