Introduction to virtual User Creation in Linux vsftpd

Source: Internet
Author: User
Article Title: Virtual User Creation in Linux vsftpd. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

1. Create a virtual user database

# Vi/tmp/logins.txt:

Longyufei

1985731

Liushuai

123456

Virtual user information, format:

<User Name>

<Password>

(Note that there cannot be spaces before and after !)

2. log on to the system as a root user and create a user database

# Db_load-T-t hash-f/tmp/logins.txt/etc/vsftpd_login.db

Create a database file/etc/vsftpd_login.db and change its file attributes:

# Chmod 600/etc/vsftpd_login.db

3. Create a PAM file and tell the system that you want to use your own database.

# Vi/etc/pam. d/ftp. vu

Content:

Auth required/lib/security/pam_userdb.so db =/etc/vsftpd_login

Account required/lib/security/pam_userdb.so db =/etc/vsftpd_login

Tell the system that the new user authorization library is in place.

4. create folders and authorize virtual users

# Useradd-d/ftp-s/sbin/nologin virtual (-d user's home directory. -S: the default shell and virtual username used by the user name)

# Chown-R virtual. virtual/ftp (change/ftp directory user .)

5. Modify the vsftpd. conf file

# Vi/etc/vsftpd. conf, and add it to the end (my configuration only retains the following content ):

Anonymous_enable = NO

Local_enable = YES

Connect_from_port_20 = YES

Listen = YES

Listen_port = 21

Tcp_wrappers = YES

Guest_enable = YES

Guest_username = virtual (all virtual users are equivalent to the permission of the virtual system account)

User_config_dir =/etc/vsftpd/user_config_dir (specify the configuration directory for each virtual user account ,)

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

Local_root =/www (specify the default ftp directory. If not set, the default ftp directory is the default directory of the ftp System Account (see/etc/passwd file content ))

The longyufei user configuration file corresponding to the user_config_dir file:

/Etc/vsftpd/user_config_dir/longyufei

Anon_world_readable_only = NO

Write_enable = YES

Anon_upload_enable = YES

Anon_other_write_enable = YES

Local_root =/www/longyufei

Anon_mkdir_write_enable = YES

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.