Gentoo installation configuration pure-ftpd combined with Mysql permission Verification

Source: Internet
Author: User

Gentoo installation configuration pure-ftpd combined with Mysql permission verification process 1. Install pure-ftpd server # echo 'Net-ftp/pure-ftpd mysql'>/etc/portage/package. useGentoo automatically installs mysql on the local machine. # Emerge pure-ftpd www.2cto.com configure the mysql database root password and install the initialization directory. My configured root password is root, if it is set to another, the following password also needs to be changed # ebuild/var/db/pkg/dev-db/mysql-5.5.28/mysql-5.5.28.ebuild config to change the content of the client segment to the following, this is to facilitate access to the mysql database # vim/etc/mysql/my. cnf [client] user = rootpassword = roothost = 127.0.0.1port = 3306 socket =/var/run/mysqld. sock [mysqld] server-id = 220skip-name-resolve #/etc/init. d/mysql start 2. Create A database and table in Mysql to store the user permission www.2cto.com # mysql-A (previously configured my. the user and password in cnf are for this purpose. (B) mysql> CREATE DATABASE IF NOT EXISTS pureftpd; mysql> USE pureftpd; mysql> CREATE TABLE IF NOT EXISTS 'ftpd' ('user' varchar (16) not null default ''comment' Username ', 'status' enum ('0', '1') not null default '0' comment' available status: 0-unavailable; 1-using ', 'Password' varchar (64) not null default ''comment' password', 'uid' varchar (11) not null default '-1 'comment' user id', 'gid' varchar (11) not null default'-1' COMMEN T 'group id', 'dir' varchar (128) not null default ''comment' permission path ', 'ulbandwidth' smallint (5) not null default '0' COMMENT 'upload bandwidth', 'dlbandwidth' smallint (5) not null default '0' comment' download bandwidth ', 'comment' tinytext not null comment' comment ', 'ipaccess' varchar (15) not null default' * 'comment' IP address ', 'quotasize' smallint (5) not null default '0' comment' size quota ', 'quotafiles' int (11) not null default '0' CO MMENT 'file type quota ', primary key ('user') ENGINE = MyISAM default charset = gbk COMMENT = 'ftp username and password table '; mysql> Add the user ftpduser to grant the select permission to the databases under pureftpd to select on pureftpd. * to ftpduser @ '%' identified by 'ftpdpassword'; mysql> adds a test data, which will be used to log on to insert into 'ftpd' ('user', 'status ', 'Password', 'uid', 'gid', 'dir', 'ulbandwidth', 'dlbandwidth', 'comment', 'ipaccess', 'quotasize ', 'quotafiles ') VALUES ('testuser ', '1', md5 ('testpassword'), '000000', '81', '/var/www', 0, 0, 'note ','*', 0, 0); 3. modify the configuration file and use MYSQL for permission verification # vim/etc/conf. d/pure-ftpdIS_CONFIGURED = "yes" SERVER = "-S 10.36.32.220, 21" MAX_CONN = "-c 50" MAX_CONN_IP = "-C 20" AUTH = "-l mysql: /etc/pureftpd-mysql.conf "MISC_OTHER ="-A-H-x-j-R-Z-E-p 50001: 59999-O clf:/var/log/pureftpd. log "# mkdir-p/var/log/pureftpd/the MYSQL configuration here is the same as that for connecting MYSQL with PHP. Note that MY SQLCrypt refers to the encryption of user passwords. Www.2cto.com # vim/etc/pureftpd-mysql.confMYSQLServer limit 3306 MYSQLUser ftpduserMYSQLPassword ftpdpasswordMYSQLDatabase limit md5MYSQLGetPW SELECT Password FROM ftpd WHERE User = "\ L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "\ R ") MYSQLGetUID SELECT Uid FROM ftpd WHERE User = "\ L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "\ R ") MYSQLGetGID SELECT Gid FROM ftpd WHERE User = "\ L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "\ R ") MYSQLGetDir SELECT Dir FROM ftpd WHERE User = "\ L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "\ R ") mySQLGetBandwidthUL SELECT ULBandwidth FROM ftpd WHERE User = "\ L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "\ R ") mySQLGetBandwidthDL SELECT DLBandwidth FROM ftpd WHERE User = "\ L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "\ R ") mySQLGetQTASZ SELECT QuotaSize FROM ftpd WHERE User = "\ L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "\ R ") mySQLGetQTAFS SELECT QuotaFiles FROM ftpd WHERE User = "\ L" AND status = "1" AND (ipaccess = "*" OR ipaccess LIKE "\ R") 4. Add the nfsuser User, and modify the permissions of the web directory. If not, create it first # groupadd apache; useradd nfsuser-u 1002-g apache-d/dev/null-s/sbin/nologin # mkdir-p/var/www # chown-R nfsuser: apache/var/www 5. Start pureftpd and test the connection with the client #/etc/init. d/pure-ftpd start

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.