CentOS平台下pureftpd搭建

运维 系统运维
CentOS平台下pureftpd搭建:CentOS下配置pureftpd还是比较常用的,这里所讲解CentOS平台下pureftpd搭建。那么该如何在CentOS平台下pureftpd搭建?本章将一一简述。

  一、系统:  CentOS 5.3

  二、软件以及下载地址

  pure-ftpd-1.0.24.tar.gz

  ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.24.tar.gz

  三、说明:用来控制用户的ftp上传功能,仅允许ftp用户在自己的目录文件下操作其网站。前提:CentOS 5.3具有搭建好的LAMP环境。

  四、搭建环境

  1、编译安装pureftp 源代码http://www.pureftpd.org/

  [root@localhost src]$ wget ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.24.tar.gz

  --16:21:29-- ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.24.tar.gz

  => `pure-ftpd-1.0.24.tar.gz.1'

  正在解析主机 ftp.pureftpd.org... 91.121.49.42

  Connecting to ftp.pureftpd.org|91.121.49.42|:21... 已连接。

  正在以 anonymous 登录 ... 登录成功!

  ==> SYST ... 完成。 ==> PWD ... 完成。

  ==> TYPE I ... 完成。 ==> CWD /pub/pure-ftpd/releases ... 完成。

  ==> SIZE pure-ftpd-1.0.24.tar.gz ... 560565

  ==> PASV ... 完成。 ==> RETR pure-ftpd-1.0.24.tar.gz ... 完成。

  长度:560565 (547K)

 

  1.   100%[=======================================>] 560,565 10.5K/s in 28s  
  2.  
  3.   16:22:04 (19.3 KB/s) - `pure-ftpd-1.0.24.tar.gz.1' saved [560565]  
  4.  
  5.   [root@localhost src]$tar zxvf pure-ftpd-1.0.24.tar.gz  
  6.  
  7.   pure-ftpd-1.0.24/  
  8.  
  9.   pure-ftpd-1.0.24/aclocal.m4  
  10.  
  11.   … …  
  12.  
  13.   pure-ftpd-1.0.24/configuration-file/pure-config.py.in  
  14.  
  15.   pure-ftpd-1.0.24/configuration-file/pure-ftpd.conf.in  
  16.  
  17.   [root@localhost pure-ftpd-1.0.24]#  
  18.  

   如果出现类似configure: error: Your MySQL client libraries aren't properly installed 的错误,将mysql目录下的 include/mysql下的mysql.h文件以及lib/mysql下的全部文件,连接(直接复制过去或许也可)到 /usr/lib 目录下.

  如果编译安装pure-ftpd出现configure: error: Your MySQL client libraries aren't properly installed错误,解决办法:

  1.   [root@jowei pure-ftpd-1.0.22]#vi /etc/profile 在最后添加  
  2.  
  3.   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mysql/lib/mysql  
  4.  

  如果出现你安装的Mysql是rpm包形式的,则直接用 --with-mysql 将其路径删除即可。

  1.   [root@jowei pure-ftpd-1.0.22]# ./etc/profile  
  2.  

  然后再进行./configure ......

  出现下面这个表示配置成功

  1.   configure: WARNING: unrecognized options: --with-largefile, --with-upload_script_, --with-virtualroot  
  2.  
  3.   configure: +--------------------------------------------------------+  
  4.  
  5.   configure: | You can subscribe to the Pure-FTPd users mailing-list |  
  6.  
  7.   configure: | to ask for help and to stay informed of new releases. |  
  8.  
  9.   configure: | Go to http://www.pureftpd.org/ml/ now! |  
  10.  
  11.   configure: +--------------------------------------------------------+  
  12.  
  13.   [root@localhost pure-ftpd-1.0.22]# make;make install  
  14.  

  五、建立配置文件

  1.   [root@localhost pure-ftpd-1.0.22]# mkdir -m 755 /usr/local/pureftpd/etc  
  2.  
  3.   [root@localhost pure-ftpd-1.0.22]#  
  4.  
  5.   cp pureftpd-mysql.conf /usr/local/pureftpd/etc/  
  6.  
  7.   [root@localhost pure-ftpd-1.0.22]#  
  8.  
  9.   cp configuration-file/pure-ftpd.conf /usr/local/pureftpd/etc/  
  10.  
  11.   [root@localhost pure-ftpd-1.0.22]# cp configuration-file/pure-config.pl /usr/local/pureftpd/bin/  
  12.  
  13.   [root@localhost pure-ftpd-1.0.22]#  
  14.  
  15.   chmod 755 /usr/local/pureftpd/bin/pure-config.pl  
  16.  
  17.   [root@localhost pure-ftpd-1.0.22]#  
  18.  
  19.   cp contrib/redhat.init /etc/init.d/pureftpd  
  20.  
  21.   [root@localhost pure-ftpd-1.0.22]# chmod 755 /etc/init.d/pureftpd  
  22.  
  23.   [root@localhost pure-ftpd-1.0.22]# chown root:root /etc/init.d/pureftpd //设置root权限  
  24.  
  25.   [root@localhost pure-ftpd-1.0.22]# chkconfig --add pureftpd  
  26.  
  27.   //加入系统启动  
  28.  
  29.   [root@localhost pure-ftpd-1.0.22]# chkconfig pureftpd on //开机启动  
  30.  
  31.   [root@localhost pure-ftpd-1.0.22]# vi /etc/init.d/pureftpd //修改pureftpd一下几项  
  32.  
  33.   # Path to the pure-ftp binaries.  
  34.  
  35.   prog=pure-config.pl  
  36.  
  37.   fullpath=/usr/local/pureftpd/sbin/$prog //修改此处  
  38.  
  39.   pureftpwho=/usr/local/pureftpd/sbin/pure-ftpwho //修改pure-ftpwho路径  
  40.  
  41.   start() {  
  42.  
  43.   echo -n $"Starting $prog: "  
  44.  
  45.   $fullpath /usr/local/pureftpd/etc/pure-ftpd.conf --daemonize //修改pure-ftpd.conf路径  
  46.  
  47.   RETVAL=$?  
  48.  
  49.   [ $RETVAL = 0 ] && touch /var/lock/subsys/$prog  
  50.  
  51.   echo  
  52.  
  53.   }  
  54.  

#p#

   六、建立mysql认证数据库表

  1.   [root@jowei pureftpd]# mysql -u root -p  
  2.  
  3.   Enter password: ----输入mysql root用户密码进入  
  4.  
  5.   mysql> create database pureftpd;  
  6.  
  7.   mysql> grant all on pureftpd.* to pureftpd@localhost identified by 'pureftpd';  
  8.  
  9.   mysql> use pureftpd  
  10.  
  11.   mysql> CREATE TABLE users (  
  12.  
  13.   id int(32) unsigned NOT NULL auto_increment,  
  14.  
  15.   User varchar(16) NOT NULL default '*',  
  16.  
  17.   Password varchar(64) NOT NULL default '*',  
  18.  
  19.   Uid varchar(11) NOT NULL default '-1',  
  20.  
  21.   Gid varchar(11) NOT NULL default '-1',  
  22.  
  23.   Dir varchar(128) NOT NULL default '-1',  
  24.  
  25.   QuotaSize smallint(5) NOT NULL default 0,  
  26.  
  27.   QuotaFiles int(11) NOT NULL default 0,  
  28.  
  29.   ULBandwidth smallint(5) NOT NULL default 0,  
  30.  
  31.   DLBandwidth smallint(5) NOT NULL default 0,  
  32.  
  33.   ULRatio smallint(6) NOT NULL default 0,  
  34.  
  35.   DLRatio smallint(6) NOT NULL default 0,  
  36.  
  37.   comment tinytext NOT NULL,  
  38.  
  39.   ipaccess varchar(15) NOT NULL default '*',  
  40.  
  41.   status enum('0','1') NOT NULL default '0',  
  42.  
  43.   create_date datetime NOT NULL default '0000-00-00 00:00:00',  
  44.  
  45.   modify_date datetime NOT NULL default '0000-00-00 00:00:00',  
  46.  
  47.   PRIMARY KEY (id,User),  
  48.  
  49.   UNIQUE KEY User (User)  
  50.  
  51.   ) TYPE=MyISAM AUTO_INCREMENT=5;  
  52.  

  建立用户

  你可以用下面建立的test用户登录到/var/pureftp

  1.   INSERT INTO users VALUES (1,'test1', '123456', '2000', '2000', '/var/pureftp', 0, 0, 0, 0, 0, 0, '*', '*', '1', '2009-7-11 09:20:33', '2009-7-11 09:20:33');  
  2.  
  3.   INSERT INTO users VALUES (1,'test2', '123456', '2000', '2000', '/var/pureftp', 0, 0, 0, 0, 0, 0, '*', '*', '1', '2009-7-11 09:20:33', '2009-7-11 09:20:33');  
  4.  

  /var/pureftp ftp登陆的文件目录

  七、建立用于pureftpd认证用户的系统信息

  你可以自己向下面这样建立一个用户做pureftpd验证但是我下面直接用的是root

  1.   [root@localhost /]# groupadd -g 2000 pureftp  
  2.  
  3.   [root@localhost /]# useradd -u 2000 -g pureftp -d /var/pureftp -s /sbin/nologin pureftp  
  4.  

#p#

  八、修改pureftpd的配置文件

  1.   [root@localhost var]# vi /usr/local/pureftpd/etc/pure-ftpd.conf  
  2.  
  3.   ############################################################  
  4.  
  5.   # #  
  6.  
  7.   # Configuration file for pure-ftpd wrappers #  
  8.  
  9.   # #  
  10.  
  11.   ############################################################  
  12.  
  13.   # 如果你想要使用配置文件代替命令行选项来运行 Pure-FTPd ,请运行下面的命令:  
  14.  
  15.   #  
  16.  
  17.   # /usr/local/pureftpd/sbin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf  
  18.  
  19.   #  
  20.  
  21.   # RPM 缺省使用另外一个配置文件:  
  22.  
  23.   # /etc/sysconfig/pure-ftpd  
  24.  
  25.   #  
  26.  
  27.   # 请不要忘了浏览一下 http://www.pureftpd.org/documentation.html 的  
  28.  
  29.   # 文档,查看全部的选项列表。  
  30.  
  31.   # 限制所有用户在其主目录中  
  32.  
  33.   ChrootEveryone yes  
  34.  
  35.   # 如果前一个指令被设置为了 "no",下面组的成员(GID)就不受主目录的限制了。而其他的用户还是  
  36.  
  37.   # 会被限制在自己的主目录里。如果你不想把任何用户限制在自己的主目录里,只要注释掉 ChrootEveryone  
  38.  
  39.   # 和 TrustedGID 就可以了。  
  40.  
  41.   # TrustedGID 100  
  42.  
  43.   # 兼容ie等比较非正规化的ftp客户端  
  44.  
  45.   BrokenClientsCompatibility no  
  46.  
  47.   # 服务器总共允许同时连接的最大用户数  
  48.  
  49.   MaxClientsNumber 50  
  50.  
  51.   # 做为守护(doemon)进程运行(Fork in background)  
  52.  
  53.   Daemonize yes  
  54.  
  55.   # 同一IP允许同时连接的用户数(Maximum number of sim clients with the same IP address)  
  56.  
  57.   MaxClientsPerIP 8  
  58.  
  59.   # 如果你要记录所有的客户命令,设置这个指令为 "yes"。  
  60.  
  61.   # This directive can be duplicated to also log server responses.  
  62.  
  63.   VerboseLog no  
  64.  
  65.   # 即使客户端没有发送 '-a' 选项也列出隐藏文件( dot-files )。  
  66.  
  67.   DisplayDotFiles yes  
  68.  
  69.   # 不允许认证用户 - 仅作为一个公共的匿名FTP。  
  70.  
  71.   AnonymousOnly no  
  72.  
  73.   # 不允许匿名连接,仅允许认证用户使用。  
  74.  
  75.   NoAnonymous no  
  76.  
  77.   # Syslog facility (auth, authpriv, daemon, ftp, security, user, local*)  
  78.  
  79.   # 缺省的功能( facility )是 "ftp"。 "none" 将禁止日志。  
  80.  
  81.   SyslogFacility ftp  
  82.  
  83.   # 定制用户登陆后的显示信息(Display fortune cookies)  
  84.  
  85.   # FortunesFile /usr/share/fortune/zippy  
  86.  
  87.   # 在日志文件中不解析主机名。日志没那么详细的话,就使用更少的带宽。在一个访问量很大  
  88.  
  89.   # 的站点中,设置这个指令为 "yes" ,如果你没有一个能工作的DNS的话。  
  90.  
  91.   DontResolve yes  
  92.  
  93.   # 客户端允许的最大的空闲时间(分钟,缺省15分钟)  
  94.  
  95.   MaxIdleTime 15  
  96.  
  97.   # LDAP 配置文件 (参考 README.LDAP)  
  98.  
  99.   # LDAPConfigFile /etc/pureftpd-ldap.conf  
  100.  
  101.   # MySQL 配置文件 (参考 README.MySQL)  
  102.  
  103.   MySQLConfigFile /usr/local/pureftpd/etc/pureftpd-mysql.conf #关键部分,你整合mysql就靠它了  
  104.  
  105.   # Postgres 配置文件 (参考 README.PGSQL)  
  106.  
  107.   # PGSQLConfigFile /etc/pureftpd-pgsql.conf  
  108.  
  109.   # PureDB 用户数据库 (参考 README.Virtual-Users)  
  110.  
  111.   # PureDB /etc/pureftpd.pdb  
  112.  
  113.   # pure-authd 的socket 路径(参考 README.Authentication-Modules)  
  114.  
  115.   # ExtAuth /var/run/ftpd.sock  
  116.  
  117.   # 如果你要启用 PAM 认证方式, 去掉下面行的注释。  
  118.  
  119.   # PAMAuthentication yes  
  120.  
  121.   # 如果你要启用 简单的 Unix系统 认证方式(/etc/passwd), 去掉下面行的注释。  
  122.  
  123.   # UnixAuthentication yes  
  124.  
  125.   # 请注意,LDAPConfigFile, MySQLConfigFile, PAMAuthentication 和  
  126.  
  127.   # UnixAuthentication 这些指令只能被使用一次,不过,他们能被混合在一起用。例如:如果你使用了  
  128.  
  129.   # MySQLConfigFile 和 UnixAuthentication,那么 SQL 服务器将被访问。如果因为用户名未找  
  130.  
  131.   # 到而使 SQL 认证失败的话,就会在/etc/passwd 和 /etc/shadow 中尝试另外一种认证,如果因  
  132.  
  133.   # 为密码错误而使 SQL 认证失败的话,认证就会在此结束了。认证方式由它们被给出来的顺序而被链  
  134.  
  135.   # 接了起来。  
  136.  
  137.   # 'ls' 命令的递归限制。第一个参数给出文件显示的最大数目。第二个参数给出最大的子目录深度。  
  138.  
  139.   LimitRecursion 2000 8  
  140.  
  141.   # 允许匿名用户创建时间:2009-11-11 15:38:00新目录?  
  142.  
  143.   AnonymousCanCreateDirs no  
  144.  
  145.   # 如果系统被 loaded 超过下面的值,匿名用户会被禁止下载。  
  146.  
  147.   MaxLoad 4  
  148.  
  149.   # 被动连接响应的端口范围。- for firewalling.  
  150.  
  151.   # PassivePortRange 30000 50000  
  152.  
  153.   # 强制一个IP地址使用被动响应( PASV/EPSV/SPSV replies)。 - for NAT.  
  154.  
  155.   # Symbolic host names are also accepted for gateways with dynamic IP  
  156.  
  157.   # addresses.  
  158.  
  159.   # ForcePassiveIP 192.168.0.1  
  160.  
  161.   # 匿名用户的上传/下载的比率。  
  162.  
  163.   # AnonymousRatio 1 10  
  164.  
  165.   # 所有用户的上传/下载的比率。  
  166.  
  167.   # This directive superscedes the previous one.  
  168.  
  169.   # UserRatio 1 10  
  170.  
  171.   # 不接受所有者为 "ftp" 的文件的下载。例如:那些匿名用户上传后未被本地管理员验证的文件。  
  172.  
  173.   AntiWarez yes  
  174.  
  175.   # 服务监听的IP 地址和端口。(缺省是所有IP地址和21端口)  
  176.  
  177.   # Bind 127.0.0.1,21  
  178.  
  179.   # 匿名用户的最大带宽(KB/s)。  
  180.  
  181.   # AnonymousBandwidth 8  
  182.  
  183.   # 所有用户的最大带宽(KB/s),包括匿名用户。  
  184.  
  185.   # Use AnonymousBandwidth *or* UserBandwidth, both makes no sense.  
  186.  
  187.   # UserBandwidth 8  
  188.  
  189.   # 新建目录及文件的属性掩码值。<文件掩码>;:<目录掩码>; .  
  190.  
  191.   # 177:077 if you feel paranoid.  
  192.  
  193.   Umask 133:022  
  194.  
  195.   # 认证用户允许登陆的最小组ID(UID) 。  
  196.  
  197.   MinUID 100  
  198.  
  199.   # 仅允许认证用户进行 FXP 传输。  
  200.  
  201.   AllowUserFXP yes  
  202.  
  203.   # 对匿名用户和非匿名用户允许进行匿名 FXP 传输。  
  204.  
  205.   AllowAnonymousFXP no  
  206.  
  207.   # 用户不能删除和写点文件(文件名以 '.' 开头的文件),即使用户是文件的所有者也不行。  
  208.  
  209.   # 如果 TrustedGID 指令是 enabled ,文件所属组用户能够访问点文件(dot-files)。  
  210.  
  211.   ProhibitDotFilesWrite no  
  212.  
  213.   # 禁止读点文件(文件名以 '.' 开头的文件) (.history, .ssh...)  
  214.  
  215.   ProhibitDotFilesRead no  
  216.  
  217.   # 永不覆盖文件。当上传的文件,其文件名已经存在时,自动重命名,如: file.1, file.2, file.3, ...  
  218.  
  219.   AutoRename no  
  220.  
  221.   # 不接受匿名用户上传新文件( no = 允许上传)  
  222.  
  223.   AnonymousCantUpload no  
  224.  
  225.   # 仅允许来自以下IP地址的非匿名用户连接。你可以使用这个指令来打开几个公网IP来提供匿名FTP,  
  226.  
  227.   # 而保留一个私有的防火墙保护的IP来进行远程管理。你还可以只允许一内网地址进行认证,而在另外  
  228.  
  229.   # 一个IP上提供纯匿名的FTP服务。  
  230.  
  231.   #TrustedIP 10.1.1.1  
  232.  
  233.   # 如果你要为日志每一行添加 PID 去掉下面行的注释。  
  234.  
  235.   # LogPID yes  
  236.  
  237.   # 使用类似于Apache的格式创建一个额外的日志文件,如:  
  238.  
  239.   # fw.c9x.org - jedi [13/Dec/1975] "GET /ftp/linux.tar.bz2" 200 21809338  
  240.  
  241.   # 这个日志文件能被 www 流量分析器处理。  
  242.  
  243.   # AltLog clf:/var/log/pureftpd.log  
  244.  
  245.   # 使用优化过的格式为统计报告创建一个额外的日志文件。  
  246.  
  247.   # AltLog stats:/var/log/pureftpd.log  
  248.  
  249.   # 使用标准的W3C格式创建一个额外的日志文件。(与大部分的商业日志分析器兼容)  
  250.  
  251.   # AltLog w3c:/var/log/pureftpd.log  
  252.  
  253.   # 不接受 CHMOD 命令。用户不能更改他们文件的属性。  
  254.  
  255.   # NoChmod yes  
  256.  
  257.   # 允许用户恢复和上传文件,却不允许删除他们。  
  258.  
  259.   # KeepAllFiles yes  
  260.  
  261.   # 用户主目录不存在的话,自动创建。  
  262.  
  263.   # CreateHomeDir yes  
  264.  
  265.   # 启用虚拟的磁盘限额。第一个数字是最大的文件数。  
  266.  
  267.   # 第二个数字是最大的总的文件大小(单位:Mb)。  
  268.  
  269.   # 所以,1000:10 就限制每一个用户只能使用 1000 个文件,共10Mb。  
  270.  
  271.   # Quota 1000:10  
  272.  
  273.   # 如果你的 pure-ftpd 编译时加入了独立服务器( standalone )支持,你能够改变 pid 文件  
  274.  
  275.   # 的位置。缺省位置是 /var/run/pure-ftpd.pid 。  
  276.  
  277.   # PIDFile /var/run/pure-ftpd.pid  
  278.  
  279.   # 如果你的 pure-ftpd 编译时加入了 pure-uploadscript 支持,这个指令将会使 pure-ftpd  
  280.  
  281.   # 发送关于新上传的情况信息到 /var/run/pure-ftpd.upload.pipe,这样 pure-uploadscript  
  282.  
  283.   # 就能读然后调用一个脚本去处理新的上传。  
  284.  
  285.   # CallUploadScript yes  
  286.  
  287.   # 这个选项对允许匿名上传的服务器是有用的。当 /var/ftp 在 /var 里时,需要保留一定磁盘空间  
  288.  
  289.   # 来保护日志文件。当所在磁盘分区使用超过百分之 X 时,将不在接受新的上传。  
  290.  
  291.   MaxDiskUsage 99  
  292.  
  293.   # 如果你不想要你的用户重命名文件的话,就设置为 'yes' 。  
  294.  
  295.   # NoRename yes  
  296.  
  297.   # 是 'customer proof' : 工作区(workaround)反对普通的客户错误,类似于:'chmod 0 public_html' 的错误。  
  298.  
  299.   # 那是一个有效的命令,不过,将导致无知的客户所定他们自己的文件,将使你的技术支持忙于愚蠢的的问题中。  
  300.  
  301.   # 如果你确信你所有的用户都有基本的Unix知识的话,这个特性将没什么用了。不过,如果你是一个主机提供商  
  302.  
  303.   # 的话,启用它。  
  304.  
  305.   CustomerProof yes  
  306.  
  307.   # 每一个用户的并发限制。只有在添加了 --with-peruserlimits 编译选项进行编译后,这个指令才起  
  308.  
  309.   # 作用。(大部分的二进制的发布版本就是例子)  
  310.  
  311.   # 格式是 : <每一个用户最大允许的进程>;:<最大的匿名用户进程>;  
  312.  
  313.   # 例如: 3:20 意思是同一个认证用户最大可以有3个同时活动的进程。而且同时最多只能有20个匿名用户进程。  
  314.  
  315.   # PerUserLimits 3:20  
  316.  

#p#

  九、修改pureftpd-mysql.conf的配置文件

  1.   [root@localhost var]# vi /usr/local/pureftpd/etc/pureftpd-mysql.conf  
  2.  
  3.   ##############################################  
  4.  
  5.   # #  
  6.  
  7.   # Sample Pure-FTPd Mysql configuration file. #  
  8.  
  9.   # See README.MySQL for explanations. #  
  10.  
  11.   # #  
  12.  
  13.   ##############################################  
  14.  
  15.   # Optional : MySQL server name or IP. Don't define this for unix sockets.  
  16.  
  17.   MYSQLServer localhost  
  18.  
  19.   #服务器地址  
  20.  
  21.   # Optional : MySQL port. Don't define this if a local unix socket is used.  
  22.  
  23.   MYSQLPort 3306  
  24.  
  25.   #服务器端口  
  26.  
  27.   # Optional : define the location of mysql.sock if the server runs on this host.  
  28.  
  29.   MYSQLSocket /tmp/mysql.sock  
  30.  
  31.   #这里换成你的真实地址  
  32.  
  33.   # Mandatory : user to bind the server as.  
  34.  
  35.   MYSQLUser root  
  36.  
  37.   #登录服务器用户名  
  38.  
  39.   # Mandatory : user password. You must have a password.  
  40.  
  41.   MYSQLPassword 123456  
  42.  
  43.   #登录服务器密码  
  44.  
  45.   # Mandatory : database to open.  
  46.  
  47.   MYSQLDatabase pureftpd  
  48.  
  49.   #配置文件所在的数据库  
  50.  
  51.   # Mandatory : how passwords are stored  
  52.  
  53.   # Valid values are : "cleartext", "crypt", "md5" and "password"  
  54.  
  55.   # ("password" = MySQL password() function)  
  56.  
  57.   # You can also use "any" to try "crypt", "md5" *and* "password"  
  58.  
  59.   MYSQLCrypt cleartext  
  60.  
  61.   #验证方式  
  62.  
  63.   # In the following directives, parts of the strings are replaced at  
  64.  
  65.   # run-time before performing queries :  
  66.  
  67.   #  
  68.  
  69.   # \L is replaced by the login of the user trying to authenticate.  
  70.  
  71.   # \I is replaced by the IP address the user connected to.  
  72.  
  73.   # \P is replaced by the port number the user connected to.  
  74.  
  75.   # \R is replaced by the IP address the user connected from.  
  76.  
  77.   # \D is replaced by the remote IP address, as a long decimal number.  
  78.  
  79.   #  
  80.  
  81.   # Very complex queries can be performed using these substitution strings,  
  82.  
  83.   # especially for virtual hosting.  
  84.  
  85.   # Query to execute in order to fetch the password  
  86.  
  87.   MYSQLGetPW SELECT Password FROM users WHERE User="\L" AND status="1" 
  88.  
  89.   #登录服务器的用户密码验证字段,status="1"为此用户必需为激活模式.  
  90.  
  91.   # Query to execute in order to fetch the system user name or uid  
  92.  
  93.   MYSQLGetUID SELECT Uid FROM users WHERE User="\L" 
  94.  
  95.   #用户的UID  
  96.  
  97.   # Optional : default UID - if set this overrides MYSQLGetUID  
  98.  
  99.   #MYSQLDefaultUID 1000  
  100.  
  101.   # Query to execute in order to fetch the system user group or gid  
  102.  
  103.   MYSQLGetGID SELECT Gid FROM users WHERE User="\L" 
  104.  
  105.   #用户的Gid  
  106.  
  107.   # Optional : default GID - if set this overrides MYSQLGetGID  
  108.  
  109.   #MYSQLDefaultGID 1000  
  110.  
  111.   # Query to execute in order to fetch the home directory  
  112.  
  113.   MYSQLGetDir SELECT Dir FROM users WHERE User="\L" 
  114.  
  115.   #用户的主目录  
  116.  
  117.   # Optional : query to get the maximal number of files  
  118.  
  119.   # Pure-FTPd must have been compiled with virtual quotas support.  
  120.  
  121.   MySQLGetQTAFS SELECT QuotaFiles FROM users WHERE User="\L" 
  122.  
  123.   #用户的最大文件数量  
  124.  
  125.   # Optional : query to get the maximal disk usage (virtual quotas)  
  126.  
  127.   # The number should be in Megabytes.  
  128.  
  129.   # Pure-FTPd must have been compiled with virtual quotas support.  
  130.  
  131.   MySQLGetQTASZ SELECT QuotaSize FROM users WHERE User="\L" 
  132.  
  133.   #用户的最大磁盘空间  
  134.  
  135.   # Optional : ratios. The server has to be compiled with ratio support.  
  136.  
  137.   MySQLGetRatioUL SELECT ULBandwidth FROM users WHERE User="\L" 
  138.  
  139.   MySQLGetRatioDL SELECT DLBandwidth FROM users WHERE User="\L" 
  140.  
  141.   #上边两项为,用户上传与下载的速度,单位 Kb/s  
  142.  
  143.   # Optional : bandwidth throttling.  
  144.  
  145.   # The server has to be compiled with throttling support.  
  146.  
  147.   # Values are in KB/s .  
  148.  
  149.   # MySQLGetBandwidthUL SELECT ULBandwidth FROM users WHERE User="\L" 
  150.  
  151.   # MySQLGetBandwidthDL SELECT DLBandwidth FROM users WHERE User="\L" 
  152.  
  153.   # Enable ~ expansion. NEVER ENABLE THIS BLINDLY UNLESS :  
  154.  
  155.   # 1) You know what you are doing.  
  156.  
  157.   # 2) Real and virtual users match.  
  158.  
  159.   # MySQLForceTildeExpansion 1  
  160.  
  161.   # If you upgraded your tables to transactionnal tables (Gemini,  
  162.  
  163.   # BerkeleyDB, Innobase...), you can enable SQL transactions to  
  164.  
  165.   # avoid races. Leave this commented if you are using the  
  166.  
  167.   # traditionnal MyIsam databases or old (< 3.23.x) MySQL versions.  
  168.  
  169.   # MySQLTransactions On  
  170.  

#p#

  十、运行pureftpd

  启动pureftpd

  1.   [root@localhost ~]# /etc/init.d/pureftpd start 或者下面也可以  
  2.  
  3.   [root@localhost ~]#/usr/local/pureftpd/bin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf  

 

【编辑推荐】

  1. Linux下vsftp服务器配置
  2. vsFTPd服务器的启动和关闭
  3. 怎样安装vsFTPd
  4. Linux下配置vsftpd
  5. vsftpd安装篇
  6. vsftpd 启动篇
  7. Linux下vsftpd的配置
  8. 如果SELinux拒绝vsftpd上传文件到用户主目录怎么办
  9. vsFTPd常用功能之限速和限制链接点
责任编辑:zhaolei 来源: CSDN网
相关推荐

2011-04-01 09:06:49

WebDAV协作平台

2011-08-17 11:28:54

Objective-C模拟开发Windows平台

2018-03-19 10:50:26

2013-03-19 09:27:37

MongoDB

2011-11-08 16:31:10

Java

2011-01-07 16:35:53

2011-03-02 13:16:33

Pureftpd

2010-07-16 11:39:36

自动登录telnet

2016-08-22 21:53:06

LinuxPython脚本

2016-08-23 10:00:28

LinuxPython脚本

2019-06-18 15:28:24

TomcatLinux优化

2011-08-29 09:33:24

WindowsQt库静态

2011-07-06 14:32:52

Mac XCode

2011-06-21 17:35:11

Qt Creator 编译

2011-03-03 15:09:30

PureFTPdFAQ

2011-02-25 16:22:34

2011-09-26 10:46:32

Android云计算开发

2009-02-10 08:57:01

分布式缓存.Net开发

2010-08-01 15:34:27

Android

2009-04-14 10:11:29

.NETWeb测试工具
点赞
收藏

51CTO技术栈公众号