Configure Vsftpd virtual users in CentOS6.6

Source: Internet
Author: User

Configure Vsftpd virtual users in CentOS6.6
# Install a software packageyum-yinstallvsftpddb4*# Disable SELinuxvim/etc/sysconfig/selinuxSELINUX=permissive# Enter the command line to immediately apply the SELinux Configurationgetenforce0# Firewall allows port 22iptables-AINPUT-mstate--stateNEW-mtcp-ptcp--dport21-jACCEPT# Create a virtual user login file, base behavior user, even number of behavior passwords, can only be written in this way, otherwise the system does not recognizevim/etc/vsftpd/logins.txtuploadpassworddownloadpasswordadminftppassword# Generate a password authentication Filedb_load-T-thash-f/etc/vsftpd/logins.txt/etc/vsftpd/vsftpd_logins.dbchmod600/etc/vsftpd/vsftpd_logins.db# Create a virtual user authentication Filevim/etc/pam.d/vsftpd.vuauthrequired/lib64/security/pam_userdb.sodb=/etc/vsftpd/vsftpd_loginsaccountrequired/lib64/security/pam_userdb.sodb=/etc/vsftpd/vsftpd_logins# The 64-bit system is/lib64/security/pam_userdb, and the 32-bit system is/lib/security/pam_userdb.# Creating a virtual useruseradd-d/home/virtualuser-s/sbin/nologinvirtualuserchmod777/home/virtualuser# Grant 777 permissions or the user cannot access# Modifying the master configuration filevim/etc/vsftpd/vsftpd.confanonymous_enable=NO# Of course, you can set it to YES and allow anonymous users to log on, but it is not recommended.local_enable=YES# It must be set to YES because the virtual user is mapped to a local user for access.local_write=NO# Local users are not allowed to writeguest_enable=YES# Enable virtual usersguest_username=virtualuser# Ing virtual userspam_service_name=vsftpd.vu# Ftp authentication Fileuser_config_dir=/etc/vsftpd/vsftpd_user_conf# Assign different permissions to different users# Create a virtual user configuration foldermkdir/etc/vsftpd/vsftpd_user_confcd/etc/vsftpd/vsftpd_user_conftouchuploaddownloadadminftpThe login name must be the same as the logins.txt file.# Download users can only download:vimdownloadlocal_root=/home/virtualuseranon_world_readable_only=NO# The upload user can only upload configurations:vimuploadlocal_root=/home/virtualuserdownload_enable=NOwrite_enable=YESanon_upload_enable=YES# Adminftp user ownership Configuration:vimadminlocal_root=/home/virtualuserdownload_enable=YESwrite_enable=YESanon_upload_enable=YESanon_mkdir_write_enable=YESanon_other_write_enable=YES# Start the service, test the virtual user, and verify the effect;servicevsftpdstartchkconfigvsftpdonftplocalhost

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.