Virtual user access to VSFTPD server via MySQL

Source: Internet
Author: User
Tags crypt administrator password

Statement

The Stars last night

Blog:http://yestreenstars.blog.51cto.com/

This article by oneself creation, if need reprint, please indicate source, thank cooperation!

Objective

through MySQL implements virtual user access to the FTP server.

Configuration

#  Install all the packages used in this experiment Yum -y install vsftpd mysql-server mysql-devel pam-devel  gcc-c++ make wget#  Start mysqld Service service mysqld start#  Initialize database administrator password mysqladmin  -uroot password redhat#  Login Database mysql -uroot -predhat#  Create Vftpuser database  database vftpuser;#  Enter Vftpuser database use vftpuser;#  CREATE table to store account and password create table  Users (Name char), Pwd char ();#  Create test User insert into users (name,pwd)  values (' Test ', password (' Test '));#  to create a user dedicated to querying the users table for security purposes Grant select on vftpuser.users to  [email protected] identified by  ' Redhat ';#  refresh permission table flush privileges;#  Leave the database quit;#  download the MySQL-certified PAM module and install the wget http://ncu.dl.sourceforge.net/project/pam-mysql/pam-mysql/ 0.7rc1/pam_mysql-0.7rc1.tar.gztar xzf pam_mysql-0.7rc1.tar.gzcd pam_mysql-0.7rc1./configuremake  && make install#  Modify the/etc/pam.d/vsftpd file, comment The original content, add the following content auth    required         /lib/security/pam_mysql.so user=vsqluser passwd=redhat host= Localhost db=vftpuser table=users usercolumn=name passwdcolumn=pwd crypt=2account  required        /lib/security/pam_mysql.so user=vsqluser  passwd=redhat host=localhost db=vftpuser table=users usercolumn=name  passwdcolumn=pwd crypt=2#  creating a local user to map a virtual user useradd -d /var/ftp/vuserdir -s /sbin/ nologin vuser#  replaces the original contents of the/etc/vsftpd/vsftpd.conf file with the following contents listen=yespam_service_name=vsftpdguest_enable= yesguest_username=vuseranonymous_enable=noanon_world_readable_only=nolocal_enable=yes#  starting the VSFTPD Services service  vsftpd start

This article is from "Last Night Stars" blog, please be sure to keep this source http://yestreenstars.blog.51cto.com/1836303/1429373

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.