Debian + vsftpd + MySQL implement virtual user _ MySQL

Source: Internet
Author: User
Tags ftp site
I used vsftpd + mysql to log on as a virtual user a few days ago. I will share my Cainiao notes with you. if you have any questions, please note that this article is not suitable for Linux's HTML version: guitarbug.googlepages.comvsftpdmysql.html ----------------------------- Debian + vsftpd + MySQL Virtual User (postedbygui debianVSFTP

I used vsftpd + mysql to log on as a virtual user a few days ago. I will share my Cainiao notes with you. please correct me if you have any questions.
Note: This article is not suitable for Linux
HTML: http://guitarbug.googlepages.com/vsftpdmysql.html

-----------------------------

Debian + vsftpd + MySQL for virtual users
(Posted by guitarbug @ 2006.6.12)

I. requirements

1. Virtual User login
Because the postfix + MySQL virtual user logon has been successfully configured, and the benefits and flexibility of using virtual users have been realized, this time we also consider using virtual users, in addition, the FTP virtual user information is also stored in MySQL. in this way, it is quite convenient to use PHP and other web gui management programs to manage users in a unified manner.

2. Restrict anonymous logon from IP addresses
Anonymous logon is enabled, but only specific IP addresses are allowed to log on anonymously.

3. different users, directories, and permissions
It sounds like a tongue twister. for example, there are two users, normal and admin, and FTP has two directories, incoming and pub, to implement the following permission settings:

Code:

Incoming pubnormal read/write read-only admin read/write


4. use FTP to manage Web sites
Apache is also set up on the server, and the website administrator is not very familiar with Linux, and does not want to open an account to the website administrator, so as not to log on to the system, it makes the system messy, so the popular practice of providing virtual hosts on the Internet is to manage websites through FTP, therefore, you need to provide an account for the website administrator to log on to FTP for website management.

5. extended functions
TBD ..

2. select FTP server software
Set up an FTP site in Linux. There are many excellent FTP server software available, such as Wu-FTPD, Pure-FTPD, ProFTPD, and vsFTPD, to select an FTP server software suitable for your needs, you also need to worry about it. for me, the choice of vsftpd (very secure FTP daemon) mainly includes the following two reasons:

1. Principle 1
Some people say that FTPD is the one you are most familiar with, but since I have no experience in setting up an FTP site in Linux, everything is a new starting point for me. on the official vsftpd homepage, we can see that Debian official FTP and RH official FTP all use vsftpd, so "stream by flow", it looks like there will be some face ~

2. selection principle 2
The second point depends largely on the name of vsftpd (very secure FTP daemon), because it is a very secure FTP Software. haha, besides, Debian official FTP uses vsftpd, it should be correct ~

PS: for the selection of FTP server software, refer to the article "simple vsftpd server setup in laruence's Linux private dish.

3. implementation
Based on Debian GNU/Linux 3.1 Sarge and vsftpd-2.0.3

1. required software packages
1), vsftpd
Very secure FTP daemon

2), mysql-server, mysql-client
The former is a MySQL database server used to store virtual user information, and the latter provides a command line MySQL Client. I have installed MySQL before configuring postfix, so I don't have to install this package. ^_^

3), libpam-mysql
Vsftpd verifies user information through PAM. this package allows PAM to read MySQL for verification.

2. install
Log on to Debian as the root user and enter the following command ~

Code:

#apt-get install vsftpd,libpam-mysql


3. create a necessary local user
Although it is a virtual user, because the virtual user information is stored in the MySQL database, a local user can read the MySQL database.

1) create the home directory of the local user, which is also the home directory of FTP

Code:

#mkdir /home/ftp


2) create a local user named ftpguest

Code:

#useradd ftpguest -d /home/ftp


3) modify the owner and Group of the FTP Home directory

Code:

#chown ftpguest.nogroup /home/ftp

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.