Allow VSFTPD virtual users to use MySQL for user authentication

Source: Internet
Author: User
Keywords VSFTPD virtual user Ftp user password
Tags accounts aliyun authenticate authentication create ftp html http

Let vsftpd virtual http://www.aliyun.com/zixun/aggregation/6579.html "> users use MySQL user authentication, you can conveniently in a machine with thousands of FTP accounts, You can use phpMyAdmin to manage your database.

Installing VSFTPD, MySQL, and phpMyAdmin

VSFTP does not have built-in MySQL support, so we must use PAM to authenticate:

sudo apt install vsftpd libpam-mysql mysql-server mysql-client

You will then ask the following questions:

New password for the MySQL "root" User: <--Yourrootsqlpassword
Repeat password for the MySQL "root" User: <--Yourrootsqlpassword
Web server to reconfigure automatically: <--apache2

Creating a MySQL Database

Now we create a database named VSFTPD and a MySQL account named VSFTPD (for the VSFTPD process connection VSFTPD database):

Mysql-u root-p

CREATE DATABASE vsftpd;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP on vsftpd.* to ' vsftpd ' @ ' localhost ' identified by ' ftpdpass ';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP on vsftpd.* to ' vsftpd ' @ ' localhost.localdomain ' identified by ' Ftpdpass ' ;
FLUSH privileges;

Ftpdpass change to the password you want, and then create the table:

Use VSFTPD;

CREATE TABLE ' accounts ' (
' ID ' INT not NULL auto_increment PRIMARY KEY,
' username ' VARCHAR not NULL,
' Pass ' VARCHAR is not NULL,
UNIQUE (
' Username '
)
) ENGINE = MYISAM;

Quit;

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.