1. 安装pure-ftpd、MySQL

apt-get purge vsftpd

apt-get purge pure-ftpd

apt-get purge pure-ftpd-common

apt-get purge pure-ftpd-mysql

apt-get purge pure-ftpd-ldap

apt-get install pure-ftpd-mysql mysql-server

2. 配置pure-ftpd

echo "yes" > /etc/pure-ftpd/conf/ChrootEveryone
echo "yes" > /etc/pure-ftpd/conf/CreateHomeDir

3. 添加FTP组、用户

groupadd ftpusers
useradd -s /bin/false -d /var/ftp -c "pure ftpd user" -g ftpusers ftpuser

4. 获取User manager for PureFTPd

wget http://machiel.generaal.net/files/pureftpd/ftp_v2.1.tar.gz
tar xvzf ftp_v2.1.tar.gz
mv ftp /var/www/
http://192.168.x.x/ftp

5. 配置pure-ftpd-mysql

vi /etc/pure-ftpd/db/mysql.conf

############################################################################
# #
# PureFTPd MySQL configuration file. #
# Generated by the installation wizard for the 'User manager for PureFTPd' #
# See http://machiel.generaal.net for more info #
# or read the README.MySQL for explanations of the syntax. #
# #
############################################################################ # Optional : MySQL server name or IP. Don't define this for unix sockets. MYSQLServer 127.0.0.1 # Optional : MySQL port. Don't define this if a local unix socket is used. # MYSQLPort 3306 # Optional : define the location of mysql.sock if the server runs on this host. MYSQLSocket /tmp/mysql.sock # Mandatory : user to bind the server as. MYSQLUser root # Mandatory : user password. You must have a password. MYSQLPassword ***** # Mandatory : database to open. MYSQLDatabase ftpusers # Mandatory : how passwords are stored
# Valid values are : "cleartext", "crypt", "md5" and "password"
# ("password" = MySQL password() function)
# You can also use "any" to try "crypt", "md5" *and* "password" MYSQLCrypt md5 # In the following directives, parts of the strings are replaced at
# run-time before performing queries :
#
# \L is replaced by the login of the user trying to authenticate.
# \I is replaced by the IP address the user connected to.
# \P is replaced by the port number the user connected to.
# \R is replaced by the IP address the user connected from.
# \D is replaced by the remote IP address, as a long decimal number.
#
# Very complex queries can be performed using these substitution strings,
# especially for virtual hosting. # Query to execute in order to fetch the password MYSQLGetPW SELECT Password FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R") # Query to execute in order to fetch the system user name or uid MYSQLGetUID SELECT Uid FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R") # Optional : default UID - if set this overrides MYSQLGetUID #MYSQLDefaultUID 1000 # Query to execute in order to fetch the system user group or gid MYSQLGetGID SELECT Gid FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R") # Optional : default GID - if set this overrides MYSQLGetGID #MYSQLDefaultGID 1000 # Query to execute in order to fetch the home directory MYSQLGetDir SELECT Dir FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R") # Optional : query to get the maximal number of files
# Pure-FTPd must have been compiled with virtual quotas support. # MySQLGetQTAFS SELECT QuotaFiles FROM users WHERE User="\L" # Optional : query to get the maximal disk usage (virtual quotas)
# The number should be in Megabytes.
# Pure-FTPd must have been compiled with virtual quotas support. # MySQLGetQTASZ SELECT QuotaSize FROM users WHERE User="\L" # Optional : ratios. The server has to be compiled with ratio support. # MySQLGetRatioUL SELECT ULRatio FROM users WHERE User="\L"
# MySQLGetRatioDL SELECT DLRatio FROM users WHERE User="\L" # Optional : bandwidth throttling.
# The server has to be compiled with throttling support.
# Values are in KB/s . MySQLGetBandwidthUL SELECT ULBandwidth FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R")
MySQLGetBandwidthDL SELECT DLBandwidth FROM users WHERE User="\L" AND Status="1" AND (Ipaddress = "*" OR Ipaddress LIKE "\R") # Enable ~ expansion. NEVER ENABLE THIS BLINDLY UNLESS :
# 1) You know what you are doing.
# 2) Real and virtual users match. # MySQLForceTildeExpansion 1 # If you upgraded your tables to transactionnal tables (Gemini,
# BerkeleyDB, Innobase...), you can enable SQL transactions to
# avoid races. Leave this commented if you are using the
# traditionnal MyIsam databases or old (< 3.23.x) MySQL versions. # MySQLTransactions On

6. 重启pure-ftpd-mysql

/etc/init.d/pure-ftpd-mysql restart

Debian+Pure-ftpd+MySQL+User manager for PureFTPd的更多相关文章

  1. mysql mHA manager 状态修改

    启动:nohup masterha_manager --conf=/etc/masterha/app1.cnf --remove_dead_master_conf --ignore_last_fail ...

  2. debian下安装mysql

    apt-get install mysql-client mysql-server 中间会要你设置password,设置后后就自己主动启动mysql了 能够用ps -ef|grep mysql 这样能 ...

  3. 在Ubuntu 或 Debian 系统环境安装MYSQL数据库

    一.第一步下载myslq安装程序 sudo apt-get install mysql-server mysql-client apt-get程序会自动下载安装最新的mysql版本.在安装的最后,它会 ...

  4. debian下安装mysql 5.1.34

    #cd /usr/local/src # tar xvzf mysql-5.1.34.tar.gz # cd mysql-5.5.1.34 配置和编译 #chmod +x configure # ./ ...

  5. debian上安装mysql server

    1 将mysql添加到apt的repository中 第一步,下载mysql提供的ppa文件 wget https://dev.mysql.com/get/mysql-apt-config_0.8.1 ...

  6. debian下重装mysql

    mysql总是报错,说sock文件不存在,网上若干方法,更改权限,更改配置文件,结果还是不能正常生成.sock文件.没办法,删除,重新安装. 完全删除: 删除 mysqlsudo apt-get au ...

  7. error: navicat 连接debian系列系统mysql 10038问题解决方案

    还特么有一种可能 阿里云 也有防火墙出口入口规则,这里也有问题

  8. debian安装mysql

    http://thirteen-tw.blogspot.com/2008/09/debian-mysql-server.html 安裝MySQL-Server debian:~# apt-get in ...

  9. debian安装及使用mysql

    在Debian中安装MySQL服务器是很方便的,使用apt-get命令即可完成. debian:~# apt-get install mysql-server mysql-client mysql-s ...

随机推荐

  1. HDU 6025 Coprime Sequence

    枚举,预处理. 预处理前缀$gcd$与后缀$gcd$,枚举删哪一个即可. #include <bits/stdc++.h> using namespace std; int T,n; ]; ...

  2. 转载:tar命令批量解压方法总结

    由于linux的tar命令不支持批量解压,所以很多网友编写了好多支持批量解压的shell命令,收集了一下,供大家分享: 第一:for tar in *.tar.gz;  do tar xvf $tar ...

  3. Unity 游戏开发技巧集锦之创建透明的材质

    Unity 游戏开发技巧集锦之创建透明的材质 Unity创建透明的材质 生活中不乏透明或者半透明的事物.例如,擦的十分干净的玻璃,看起来就是透明的:一些塑料卡片,看起来就是半透明的,如图3-23所示. ...

  4. 获取token

    获取token 提示:openstack 这个是获取N版的方法 ,主要区别在于这个路径上(http://192.168.0.228:35357/v3/auth/tokens ),以前版本可能会是v2 ...

  5. python 学习笔记 - Queue & Pipes,进程间通讯

    上面写了Python如何创建多个进程,但是前面文章中创建的进程都是哑巴和聋子,自己顾自己执行,不会相互交流.那么如何让进程间相互说说话呢?Python为我们提供了一个函数multiprocessing ...

  6. FastReport.Net使用:[28]数据合并

    基础数据 1.拖动数据源中的数据列到报表设计器中,获得一张简单的报表. 2.下面使用两种方法将期中考试和期末考试的成绩合并到一行显示 合并数据(分组方法) 1.按学生名字和科目来进行分组,成绩文本框咱 ...

  7. p1315构建双塔 dp

    From easthong ☆构建双塔                 描述 Description     2001年9月11日,一场突发的灾难将纽约世界贸易中心大厦夷为平地,Mr. F曾亲眼目睹了 ...

  8. JZYZOJ1261 字典序最小的lis

    http://172.20.6.3/Problem_Show.asp?id=1261   求字典序方法: f[i]表示i位数字的最长上升子序列长度,len为最长上升子序列长度,ans[t]为第t位答案 ...

  9. uoj386 【UNR #3】鸽子固定器

    link (似乎很久没写题解了) 题意: n个物品,每个物品有a,b两个值,给定A,B,现在最多选其中m个,要求最大化选出的物品中[b权值和的B次方-a极差的A次方]. $n\leq 2\times ...

  10. Google图片和NASA 网站图片的爬虫

    1.根据关键字爬取NASA网站上的图片 首先针对需要爬取的网站进行分析,输入关键字查找需要的内容 通过关键字请求,网页每次会加载20张的缩略图,分析网页源码能够很容易的找到缩略图的url: 然后再点开 ...