Vsftp set up virtual users different directories assign different permissions operation steps detailed

Source: Internet
Author: User
Tags ftp login

This article mainly introduces the VSFTP set up the virtual user different directory allocation different permissions operation steps in detail, everyone refer to set their own FTP server bar VSFTPD server supports anonymous users, local Users and virtual users three types of user accounts, using Virtual user account can provide a centrally managed FTP root directory , to facilitate the management of the Administrator, at the same time, the user name, password for FTP login and the System user account is distinguished, further enhance the security of the FTP server. 1. Add or change the following configuration statement in/etc/vsftpd/vsftpd.conf: Copy the Code code as follows: Anonymous_enable=no (you can also set it to Yes while allowing anonymous users to log in) Local_enable=yes (It must be set to Yes, because the virtual user is the one that maps to the local user of virtual) Guest_enable=yes (enabled virtual user) Guest_username=virtual (created in the 5th step, Map a virtual user to a local virtual user) Pam_service_name=vsftpd.vu (created in 2nd step, specifying the PAM configuration file, the file already exists in/etc/pam.d/) user_config_dir=/etc/vsftpd /user_conf (7th, create in 8 step, specify the storage path of different virtual user profiles) 2, modify the file vsftpd.vu in/etc/pam.d/, compare the contents: Copy the Code code as follows: Auth required pam_userdb.so db =/etc/vsftpd/vsftpd_login account required pam_userdb.so db=/etc/vsftpd/vsftpd_login (/etc/vsftpd/vsftpd_login in 3rd, 4 steps to create, user account password database file) 3, establish the user list/tmp/logins.txt the following copy code code: web (account) ****** (user password) download (account) ******* (user password) admin (account) * * * (User password) Note: Do not have a blank line, one line of account password; Odd behavior account number, even behavior Password 4, build visitor data file (if not available: Yum install db4-utils) #db_load-T-t hash-f/tmp/ Logins.txt/etc/vsftpd/vsftpd_login.db 5, establish a local virtual User: Copy code code as follows: #useradd-d/home/ftp-s/sbin/nologin Virtual 6, create a directory in/home/ftp/and change its properties and its host copy code code as follows: #chown VIRTUAL/HOME/FTP#CHMOD 700/ Home/ftp 7, create the FTP User Configuration file directory:/etc/vsftpd/user_conf copy code code as follows: #mkdir/etc/vsftpd/user_conf 8,/etc/vsftpd/user_ In the Conf directory, create a profile that is named after the user name Web, download, admin "Download" File content as follows: The copy code code is as follows: Local_root=/home/ftp (of course, you can also be happy to set the other, However, be aware of the virtual user's permissions to this directory) Anon_world_readable_only=no (so that download users can download, but also only download; write Yes, you will not be able to list files and directories) the "admin" file reads as follows: Copy code code as follows : Local_root=/home/ftpanon_world_readable_only=nowrite_enable=yes (Write permission) anon_mkdir_write_enable=yes (new directory permission) anon_ Upload_enable=yes (upload permission) anon_other_write_enable=yes (permissions to delete/rename) the contents of the Web file are as follows: Copy the code code as follows: Local_root=/var/wwwanon_ world_readable_only=noanon_umask=022 (due to the particularity of the Web page, so the individual set upload file permission is 755, this mask value can be changed depending on the situation) Write_enable=yes (Write permission) Anon_mkdir _write_enable=yes (new directory permission) anon_upload_enable=yes (upload permission) anon_other_write_enable=yes (permission to delete/rename) 9, finally, Restart the VSFTPD copy code code as follows: #/etc/init.d/vsftpd restart

  

Vsftp set up virtual users different directories assign different permissions operation steps detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.