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. 完美解决doc、docx格式word转换为Html

    http://blog.csdn.net/renzhehongyi/article/details/48767597

  2. 「Ionic」WebStorm的使用錯誤-

    前言:遇到這個錯誤,不要慌張,搶按照濤叔下面的方式處理就可以了. 1.Couldn't find ionic.config.json file. Are you in an Ionic project ...

  3. 在Linux中设置UMASK值

    umask值用于设置用户在创建文件时的默认权限,当我们在系统中创建目录或文件时,目录或文件所具有的默认权限就是由umask值决定的. 对于root用户,系统默认的umask值是0022:对于普通用户, ...

  4. Python开发基础-Day32 进程间通信、进程池、协程

    进程间通信 进程彼此之间互相隔离,要实现进程间通信(IPC),multiprocessing模块支持两种形式:队列和管道,这两种方式都是使用消息传递的. 进程队列queue 不同于线程queue,进程 ...

  5. 打开tcp_tw_recycle引起的一个问题

    今天普空说了一个问题就是如果设置了tcp_tw_recycle ,那么如果客户端是NAT出来的,那么就可能会出现连接被直接rst的情况.然后我google了下,在内核列表也有人说了这个问题 https ...

  6. python邮件

    解读Python发送邮件 Python发送邮件需要smtplib和email两个模块.也正是由于我们在实际工作中可以导入这些模块,才使得处理工作中的任务变得更加的简单.今天,就来好好学习一下使用Pyt ...

  7. 什么是DQL、DML、DDL、DCL

    SQL(Structure Query Language)语言是数据库的核心语言. SQL的发展是从1974年开始的,其发展过程如下: 1974年-----由Boyce和Chamberlin提出,当时 ...

  8. QTREEⅠ SPOJ

    树剖模板,注意把边化为点后要查到y的儿子. #include<bits/stdc++.h> using namespace std; ; int f[N],bel[N],w[N],id[N ...

  9. [BZOJ4556][TJOI2016&&HEOI2016]字符串(二分答案+后缀数组+RMQ+主席树)

    4556: [Tjoi2016&Heoi2016]字符串 Time Limit: 20 Sec  Memory Limit: 128 MBSubmit: 1360  Solved: 545[S ...

  10. hdu 4284 状态压缩dp

    题意: 有N 个点的无向图,要去其中 h个地点做事,做事需要先办理护照,之后可以挣一定数量的钱,知道了一开始有的总钱数,和 一些城市之间           道路的花费,问可不可以在 指定的 h 个城 ...