Home > Database > Mysql Tutorial > body text

Ubuntu下构建基于MySQL管理的pure-ftpd

WBOY
Release: 2016-06-07 16:55:19
Original
940 people have browsed it

第一步:安装pure-ftpd和pure-ftpd-mysql.apt-get install pure-ftpdapt-get install pure-ftpd-mysql第二步:修改pure-ftpd链接

第一步:安装pure-ftpd和pure-ftpd-mysql.
apt-get install pure-ftpd
apt-get install pure-ftpd-mysql

第二步:修改pure-ftpd链接mysql的密码
vim /etc/pure-ftpd/db/mysql.conf
默认配置:#MYSQLServer     localhost
#MYSQLPort       3306
MYSQLSocket     /tmp/mysql.sock
MYSQLUser       root
MYSQLPassword   这里填写你的密码  
MYSQLDatabase   pureftpd
MYSQLCrypt      cleartext
MYSQLGetPW      SELECT Password FROM users WHERE User=”\L”
MYSQLGetUID     SELECT Uid FROM users WHERE User=”\L”
MYSQLGetGID     SELECT Gid FROM users WHERE User=”\L”
MYSQLGetDir     SELECT Dir FROM users WHERE User=”\L”
第三步创建管理数据库:
msyql -u root -p
输入mysql密码进入
mysql>create database pureftpd;
mysql>use pureftpd;
创建users表:
CREATE TABLE users (
User CHAR(32) BINARY NOT NULL,
Password CHAR(64) BINARY NOT NULL,
Uid INT(11) NOT NULL default ‘-1′,
Gid INT(11) NOT NULL default ‘-1′,
Dir CHAR(256) BINARY NOT NULL,
PRIMARY KEY  (User)
);

第四步:创建用户及目录
groupadd www
useradd -g www www
mkdir -p 目录位置 (比如我的是 /data)
chown -R www:www 目录位置 (比如我的是 /data)
获取用户id及所在组的组id
id www
结果:uid=1001(www) gid=1001(www) groups=1001(www)
将用户数据插入到数据库用以验证
insert into users values(’www’,'123456′,1001,1001,’/data’);
几个值分别对应 用户名 密码 uid gid 操作目录

第五步:重启pure-ftpd
/etc/init.d/pure-ftpd restart

这样一来,你的服务器就支持ftp了…

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template