Virtual user access to VSFTPD server via MySQL

Source: Internet
Author: User
Tags crypt administrator password

Configuration
# Install all the packages used in this experimentYum-y Install vsftpd mysql-server mysql-devel pam-devel gcc-c++ make wget# start mysqld serviceService mysqld Start# Initialize the database administrator passwordMysqladmin-uroot Password Redhat# Log in to databaseMysql-uroot-predhat# Create a vftpuser databaseCreate Database Vftpuser;# Enter the Vftpuser databaseUse Vftpuser;# Create tables to store accounts and passwordsCREATE table users (name char ( A),pwdChar A));# Create a test userInsert into users (name,pwd) VALUES (' Test ', Password (' Test '));# For security purposes, create a user that is dedicated to querying the users tableGrant Select on vftpuser.users to [email protected] identified by' Redhat ';# Refresh Permissions TableFlush privileges;# Leave the databaseQuit# Download the mysql-certified PAM module and install itwget http://ncu.dl.sourceforge.net/project/pam-mysql/pam-mysql/0.7rc1/pam_mysql-0.7RC1.tar.gztar Xzf pam_mysql-0.7RC1.tar.gzCDpam_mysql-0.7Rc1./configuremake && make Install# Modify the/etc/pam.d/vsftpd file, comment The original content, add the following contentAuth required/lib/security/pam_mysql.so user=vsqluser passwd=redhat host=localhost db=vftpuser table=users User Column=name passwdcolumn=pwdcrypt=2Account required/lib/security/pam_mysql.so user=vsqluser passwd=redhat host=localhost db=vftpuser table=users User Column=name passwdcolumn=pwdcrypt=2# Create Local users to map virtual usersUseradd- D/var/ftp/vuserdir- S/sbin/nologin VUser# Replace the original contents of the/etc/vsftpd/vsftpd.conf file with the following :Listen=yespam_service_name=vsftpdguest_enable=yesguest_username=vuseranonymous_enable=noanon_world_readable_ Only=nolocal_enable=yes# start VSFTPD serviceService VSFTPD Start

Virtual user access to VSFTPD server via MySQL

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.