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. Java学习(构造方法、this关键字、super应用)

    构 造 方 法 定义:对象创建时使用的方法,即在new一个新对象时,对应构造方法,直接对属性赋值. 语句格式:    修饰符(public 等) 构造方法名(必须跟当前类名一样,否则报错)(参数列表) ...

  2. 牛客练习赛19 C-托米航空公司

    思路:轮廓线dp,找bug找死我了. #include<bits/stdc++.h> #define LL long long #define fi first #define se se ...

  3. 记录自己在 cmd 中执行 jar 文件遇到的一些错误

    记录自己在 cmd 中执行 jar 文件遇到的一些错误 场景: 请求接口,解析接口返回的 JSON 字符串并插入到我们的数据库里面. 情况: 项目在 eclipse 中正常运行,打成 jar 包后在 ...

  4. 湖南大学ACM程序设计新生杯大赛(同步赛)H - Yuanyuan Long and His Ballons

    题目描述 Yuanyuan Long is a dragon like this picture?                                     I don’t know, ...

  5. 爱奇艺全国高校算法大赛初赛B

    二分,验证. 二分一下答案,然后验证一下统计个数能否满足即可. #include <cstdio> #include <cmath> #include <cstring& ...

  6. Servlet技术——常用的类和接口

    Servlet是运行在服务器端的Java应用程序,由Servlet容器对其进行管理. 当用户对容器发送HTTP请求时,容器将通知相应的Servlet对象进行处理,完成用户和程序之间的交互. 在Serv ...

  7. Trie树入门

    Trie树入门 貌似很多人会认为\(Trie\)是字符串类型,但是这是数据结构!!!. 详情见度娘 下面开始进入正题. PS:本文章所有代码未经编译,有错误还请大家指出. 引入 先来看一个问题 ​ 给 ...

  8. Selenium快速入门(下)

    Frame相关 import time from selenium import webdriver from selenium.common.exceptions import NoSuchElem ...

  9. BZOJ1087【状压DP】

    题目链接[http://www.lydsy.com/JudgeOnline/problem.php?id=1087] 题意:在N×N的棋盘里面放K个国王,使他们互不攻击,共有多少种摆放方案.国王能攻击 ...

  10. 【欧拉函数】BZOJ4173-数学

    [题目大意] [思路] 基本是popoqqq大爷的题解,稍微添加了几句自己的注释,方便理解 同理,如果n%k+m%k<k等价于0 =∑([(n+m)/k]-[n/k]-[m/k])×φ(k) … ...