LinuxÒÁµéÔ°ÂÛ̳'s Archiver

lixiyanny ·¢±íÓÚ 2007-12-11 15:21

pureftpd+ftp_v2.1¹ÜÀí³ÌÐòÎÊÌâ

[url]http://szakx.kmip.net/pureadmin[/url]   ÎÒÍøÉÏÏÂÔØµÄftp_v2.1¹ÜÀí³ÌÐò

[url]http://szakx.kmip.net/ftpadmin[/url]    ÏÖÔÚÕýÔÚʹÓõģ¬Ò²¾ÍÊÇÍøÉÏ˵µÄpureftpdadminºº»¯°æ

ÇëÎÊÏÂÎÒÈçºÎ²ÅÄÜʹÓÃ[url]http://szakx.kmip.net/pureadmin[/url]À´¹ÜÀíFTPÄØ£¿Óû§Ãû£ºadmin admin

°²×°¹ý³ÌÈçÏ£º

#  tar zxvf pure-ftpd-1.0.20.tar.gz
#  cd pure-ftpd-1.0.20
#  ./configure --prefix=/usr/local/pureftpd --with-mysql=/bluemail/mysql --with-paranoidmsg --with-shadow --with-welcomemsg --with-uploadscript --with-quotas --with-cookie --with-virtualhosts  --with-virtualroot --with-diraliases --with-sysquotas --with-ratios --with-ftpwho --with-throttling --with-language=simplified-chinese
               
#make
#make check
#make install
#mkdir -m 777 /usr/local/pureftpd/etc
#cp pureftpd-mysql.conf /usr/local/pureftpd/etc/pureftpd-mysql.conf
#cp configuration-file/pure-ftpd.conf /usr/local/pureftpd/etc/pure-ftpd.conf
#cp configuration-file/pure-config.pl /usr/local/pureftpd/bin/pure-config.pl

×¢Òâ    --prefix=/usr/local/pureftpd ²ÎÊýÖ¸¶¨ÁËpureftpdµÄ°²×°Â·¾¶
        --with-mysql=/usr/local/mysql ²ÎÊýÖ¸¶¨ÁËmysqlµÄ°²×°Â·¾¶
        --with-language=simplified-chinese ²ÎÊýÖ¸¶¨ÁË·þÎñÆ÷·µ»ØÐÅϢʹÓõÄÓïÑÔ

¶þ¡¢½¨Á¢mysqlÈÏÖ¤Êý¾Ý¿â±í

    ÔÚmysql·þÎñÆ÷Öн¨Á¢pureftpdÊý¾Ý¿â

mysql> CREATE DATABASE pureftpd;
mysql> grant all on pureftpd.* to pureftpd@localhost identified by 'pureftpd';
mysql> use pureftpd;
mysql> CREATE TABLE `users` (
       `id` int(32) unsigned NOT NULL auto_increment,
       `User` varchar(16) NOT NULL default '',
       `Password` varchar(64) NOT NULL default '',
       `Uid` varchar(11) NOT NULL default '-1',
       `Gid` varchar(11) NOT NULL default '-1',
       `Dir` varchar(128) NOT NULL default '',
       `QuotaSize` smallint(5) NOT NULL default '0',
       `QuotaFiles` int(11) NOT NULL default '0',
       `ULBandwidth` smallint(5) NOT NULL default '0',
       `DLBandwidth` smallint(5) NOT NULL default '0',
       `ULRatio` smallint(6) NOT NULL default '0',
       `DLRatio` smallint(6) NOT NULL default '0',
       `comment` tinytext NOT NULL,
       `ipaccess` varchar(15) NOT NULL default '*',
       `status` enum('0','1') NOT NULL default '0',
       `create_date` datetime NOT NULL default '0000-00-00 00:00:00',
       `modify_date` datetime NOT NULL default '0000-00-00 00:00:00',
       PRIMARY KEY  (`id`,`User`),
       UNIQUE KEY `User` (`User`)
       ) TYPE=MyISAM AUTO_INCREMENT=5 ;


Èý¡¢½¨Á¢ÓÃÓÚpureftpdÈÏÖ¤Óû§µÄϵͳÐÅÏ¢

    ½¨Á¢ÓÃÓÚpureftpdÈÏÖ¤Óû§µÄµÇ½Ŀ¼
#  mkdir /ftproot

    ½¨Á¢ÓÃÓÚpureftpdÈÏÖ¤Óû§µÄϵͳ×éºÍϵͳÓû§
#  groupadd pureftpusers -g 2000
#  useradd pureftpusers -u 2000 -g pureftpusers -d /ftproot -s /sbin/nologin

    ·ÖÅäĿ¼ȨÏÞ
# chown pureftpusers /ftproot
# chgrp pureftpusers /ftproot

    ÉèÖÃĿ¼ֻ¶Á
# chmod 500 /ftproot
# chmod 700 /ftproot


ËÄ¡¢ÐÞ¸ÄpureftpdµÄÅäÖÃÎļþ

    ÐÞ¸ÄÅäÖÃÎļþ
vi /usr/local/pureftpd/etc/pure-ftpd.conf

´úÂë:
MaxClientsNumber            100
MaxClientsPerIP             3
MaxIdleTime                 5
MySQLConfigFile             /usr/local/pureftpd/etc/pureftpd-mysql.conf
# Disallow downloading of files owned by "ftp", ie.
# files that were uploaded but not validated by a local admin.
AntiWarez                   no
Bind                      *,2121
# Maximum bandwidth for anonymous users in KB/s
AnonymousBandwidth            800
# Allow FXP transfers for authenticated users.
AllowUserFXP                yes
NoChmod                     yes
IPV4Only                    yes
DisplayDotFiles             no


´úÂë:
vi /usr/local/pureftpd/etc/pureftpd-mysql.conf

´úÂë:
MYSQLUser       pureftpd
MYSQLPassword   pureftpd
#ÃÜÂëÔÚÊý¾Ý±íÖеĴ洢·½Ê½£¬ÕâÀïÑ¡Ôñ¼ÓÃÜ
MYSQLCrypt      crypt
MYSQLSocket     /temp/mysql.sock


Îå¡¢ÔËÐÐpureftpd

ÔÚmysqlÊý¾Ý±íÖÐÏȼÓÈëÒ»¸ö²âÊÔÓû§test,ÃÜÂëÒ²ÊÇtest
´úÂë:
INSERT INTO `users` VALUES (1, 'test', encrypt('test'), '2000', '2000', '/ftproot', 0, 0, 0, 0, 0, 0, '', '*', '1', '2005-04-04 09:20:33', '2005-04-04 09:20:33');

ÔËÐÐpureftpd·þÎñÆ÷
´úÂë:
/usr/local/pureftpd/bin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf

Ò³: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.