Configure vsftpd virtual users under SUSE11

Source: Internet
Author: User
Environment and software SUSELinuxEnterpriseServer11 (x86_64) vsftpd-2.0.7-4.17.1.x86_64.rpm modify vsftp configuration file parameters (/etc/vsftpd. conf) anonymous_enableNOlocal_enableYESchroot_list_enableYES...

Environment and software

SUSE Linux Enterprise Server 11 (x86_64)

Vsftpd-2.0.7-4.17.1.x86_64.rpm

Modify vsftp configuration file parameters (/etc/vsftpd. conf)

Anonymous_enable = NO

Local_enable = YES

Chroot_list_enable = YES # Convert the user listed in chroot_list to the directory defined in the file defined in user_config_dir. "NO" is the default directory of the system user.

Chroot_list_file =/etc/vsftpd/chroot_list # This is the file for storing the chroot user. we will create

Add vsftp configuration file parameters (/etc/vsftpd. conf)

Userlist_enable = YES
Userlist_deny = NO
User_config_dir =/etc/vsftpd_user_conf # Main Directory of the Virtual User configuration file. this directory is created later when a virtual user is created.
Guest_enable = YES
Guest_username = virtual # system user mapped by the virtual user, which will be created later

Restart ftp server:/etc/init. d/vsftpd restart

Modify pam verification (/etc/pam. d/vsftpd. the file name corresponds to pam_service_name = vsftpd in/etc/vsftpd. conf)

Comment out all parameters and add the following two lines at the beginning

Auth sufficient/lib64/security/pam_userdb.so db =/etc/vsftpd/vsftpd_login #/vsftpd_login is the authentication file to be created. The real file is vsftpd_login.db, and there is no suffix

Account sufficient/lib64/security/pam_userdb.so db =/etc/vsftpd/vsftpd_login # The host is 64-bit. if it is 32-bit, use lib instead

Create a system user (guest_username = virtual), or use an existing system user

Useradd-d/ftp_server/virtual
Create a virtual user

Vi/etc/vsftpd/logins.txt
The following is the content of logins.txt (odd behavior username, even behavior password)
Download
Download
Admin
Upanddownadnwrite

Compile virtual user information

Db_load-T-t hash-f/etc/vsftpd/login.txt/etc/vsftpd/vsftpd_login.db # Information in/etc/pam. d/vsftpd

Add chroot_list information (virtual user name. if this user is not available, the directory will be located in the directory specified during virtual creation)

Vi/etc/vsftpd/chroot_list

The content of chroot_list is as follows:

Download

Admin
Add vsftpd. user_list information (the content is the same as that of chroot_list and put it in the/etc/Directory. Otherwise, the defined virtual user cannot log on)

Add custom virtual user information. the file name is the same as the virtual user name (user_config_dir =/etc/vsftpd_user_conf. if there is no user in this directory, use/etc/vsftpd. conf default configuration)

Download file content:

Local_root =/ftp_server/download # specify the address of the user's home directory. Note that the read and write permissions must be granted to the created directory. the chmod o + rw directory name
Write_enable = YES
Download_enable = YES
Anon_world_readable_only = NO
Anon_upload_enable = YES
Anon_mkdir_write_enable = YES
Anon_other_write_enable = YES
Local_umask = 022
 

Admin file content:
Local_root =/ftp_server/admin # specify the address of the user's home directory. Note that the read and write permissions must be granted to the created directory.
Write_enable = YES
Download_enable = YES
Anon_world_readable_only = NO
Anon_upload_enable = YES
Anon_mkdir_write_enable = YES
Anon_other_write_enable = YES
Local_umask = 022

From: Sun Jie's technology mess

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.