How to establish virtual users of vsftpd (1)

Source: Internet
Author: User

We have already elaborated on the installation and configuration of the FTP server. Here we will analyze the establishment of relevant users. The local user will not be introduced here. This article mainly introduces two methods for implementing virtual users: vsftpd's virtual user creation process.

1. Use a local data file:

Generate a virtual user file and create the/etc/vsftpd/vuser.txt file. The content is as follows:

Tonyzhang # virtual user 1111 # virtual user 1 Password tomqin # virtual user 2111 # virtual user 2 Password

Install build Database rpm package: db4-utils 。

 
 
  1. rpm -ivh db4-utils-4.3.29-9.fc6.i386.rpm  

Generate a virtual user database 。

 
 
  1. db_load -T -t hash -f /etc/vsftpd/vuser.txt /etc/vsftpd/vuser.txt  

Create a local ing user and modify the local ing user's home directory permissions 。

 
 
  1. useradd -d /var/ftp/vuserdir  -s /sbin/nologin vuserchmod o+rw /var/ftp/vuserdir  

Modify the pam Authentication file/etc/pam. d/vsftpd and comment out the original content 。

 
 
  1. authrequired  /lib/security/pam_userdb.so db=/etc/vsftpd/vusersaccount required  
  2. /lib/security/pam_userdb.so db=/etc/vsftpd/vusers 

Modify/etc/vsfptd/vsftp. conf and add the following content 。

 
 
  1. guest_enable=YESguest_username=vuser  

2. Use MySQL Data Files:

Create a local ing user 。

 
 
  1. useradd -s /sbin/nologin vuser  

Modify/etc/vsfptd/vsftp. conf and add the following content 。

 
 
  1. guest_enable=YESguest_username=vuser  

Install MySQL and related software packages 。

 
 
  1. yum -y install mysql.i*yum -y install perl-DBD-MySQL.i*yum 
  2. -y install mysql-server.i*yum -y install mysql-devel.i*  

Create a database and user table in MySQL 。

 
 
  1. [Root @ polo]
  2. # Mysql-u root mysql-pmysql> create database ftpvuser;
  3. # Creating a user database
  4. Mysql> use ftpvuser;
  5. # Open a database
  6. Mysql> create table users (name char (16) binary, passwd char (16) binary );
  7. # Create an access user information table
  8. # Insert two users and passwords
  9. Mysql> insert into users (name, passwd) values ('tonyzhang ', password ('123 '));
  10. Mysql> insert into users (name, passwd) values ('tomqin', password ('123 '));


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.