RHEL5 VSFTP server based on virtual user authentication

Source: Internet
Author: User
1. create the logins.txt/etc/vsftpd/login.txt file of the virtual user database as follows, even line set password 2, generate vsftpd authentication file # db_load-T-thash-f/etc/vsftpd/logins.txt/et...

1. create the logins.txt file of the virtual user logging database.

The/etc/vsftpd/login.txt file contains the following content:

Set the username for odd lines in the password library file, and set the password for even lines

2. Generate the authentication file for vsftpd

# Db_load-T-t hash-f/etc/vsftpd/logins.txt/etc/vsftpd/login. db # Generate the authentication database file login. db

Note: If the db_load command is not available, install the following RPM package.

3. set the authentication file to be readable and writable only to the root user.

# Chmod 600/etc/vsftpd/login. db

4. create the PAM configuration file required by the virtual user and manually create the vsftpd. vu file.

# Vim/etc/pam. d/vsftpd. vu:

5. create a system user account used by all FTP virtual user accounts, and set permissions for the home directory of the account.

# Useradd-s/sbin/nologin-d/home/vftp

6. set the vsftpd. conf configuration file.

# Vi/etc/vsftpd. conf

Add virtual user configuration content to the configuration file (it is best to disable anonymous accounts)

Guest_enable = YES

Guest_username = vftp

Pam_service_name = vsftpd. vu (to correspond to the PAM file just created)

User_config_dir =/etc/vsftpd/user_config_dir (specify the configuration directory for each virtual user account ,)
Local_root =/ftpsite (this line does not exist. the virtual user logs on to/home/vftp)

7. configure virtual user name settings

# Mkdir-p/etc/vsftpd/user_config_dir (corresponding to the main configuration file)
# Mkdir-p/ftpsite/vuser1 (create a virtual home directory)
# Chmod-R 777/ftpsite/vuser1 (set permissions)

# Vi/etc/vsftpd/user_config_dir/vuser1 (vuser1 permission configuration file), the content is as follows:
Anon_world_readable_only = NO
Write_enable = YES
Anon_upload_enable = YES
Anon_other_write_enable = YES
Local_root =/ftpsite/vuser1
Anon_mkdir_write_enable = YES

Create a vuser2 Virtual User configuration file in the same way.

8. restart the vsftpd service program.

9. use a virtual account to log on to the system as follows:

This article is not only a personal honor, "blog

Related Article

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.