最新消息:

Linux学习笔记之pureftp(五)常见问题

IT技术 ipcpu 5640浏览

pureftp的一些常见问题:

1.默认安装时允许匿名用户和系统非root用户登录
系统认证方式有
LDAPConfigFile  MySQLConfigFile PGSQLConfigFile PureDB ExtAuth PAMAuthentication UnixAuthentication等。

启用其中一个认证时,就只能使用该认证了。原有系统用户就无法登陆了,但如果允许匿名用户登录,匿名的是可以登录的。

2.上传下载速度的限制不是很准确,浮动较大,比vsftp要差一些。

3.磁盘配额不是实时的。

4.常见错误
./pure-config.py pure-ftpd.conf
Running: ['/usr/local/pureftpd/sbin/pure-ftpd', '-A', '-c', '50', '-B', '-C', '8', '-D', '-f', 'ftp', '-H',

'-I', '15', '-l', 'puredb:/usr/local/pureftpd/etc/pureftpd.pdb', '-L', '10000:8', '-m', '4', '-s', '-U',

'133:022', '-u', '100', '-k', '99', '-Z']
421 Unknown authentication method: puredb:/usr/local/pureftpd/etc/pureftpd.pdb
或者是:421 Unknown authentication method:  mysql :/usr/local/etc/pureftpd-mysql.conf

这是由于在编译时没有加入相关选项造成的。
重新编译
./configure –prefix=/usr/local/pureftpd/ –with-puredb
实践证明–with-everything并不一定会把所有东西加进去的。

5.pureftp的编码问题

pureftp支持RFC2640,可以有效解决Windows和Linux下的编码问题

使用方法:
重新编译加入RFC2640支持
./configure –prefix=/usr/local/pureftpd/ –with-puredb –with-everything –with-rfc2640

vi pure-ftpd.conf
ClientCharset           gb2312

重新启动服务器即可,常见的IE浏览器,FlashFXP可以正常使用GB2312,utf-8编码。
而Linux系统自带的ftp和Windows系统自带的ftp客户端,仍然存在乱码现象。

6.关于pureftp的被动模式

服务器默认开启主动模式和被动模式,由客户端选择。

服务器可以设置被动模式端口范围,主要是为了防火墙的设置。
PassivePortRange      50001 50006
注意此处千万不可写成50001:50006 ,否则配置文件脚本无法读取,中间是空格。

我们做了几个实验:
PassivePortRange  设置成如下值,客户端登陆提示如下:

PassivePortRange 50001 50006  登录时显示You are user number 1 of 3 allowed.
PassivePortRange 50001 50004  登录时显示You are user number 1 of 2 allowed
PassivePortRange 50001 50003  登录时显示You are user number 1 of 1 allowed

这恰好印证了官方文档中的说明:
So, open some ports TO the FTP server. These ports should be > 1023. It’s
recommended to use at least twice the max number of clients you are
expecting. So, if you accept 200 concurrent sessions, opening ports 50000 to
50400 is ok.

每个连接至少需要两个端口。

另外官方文档说,端口范围开放的越大,越安全。
Unlike some popular belief, the MORE opened ports you have for passive FTP,
the MORE your FTP server will be secure, because the LESS you are vulnerable
to data hijacking.

转载请注明:IPCPU-网络之路 » Linux学习笔记之pureftp(五)常见问题