免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4243 | 回复: 1
打印 上一主题 下一主题

[FTP] wu-ftpd简单配置 [复制链接]

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-01-20 13:06 |只看该作者 |倒序浏览
1./etc/ftpaccess的设定

这个配置文件是ftp服务器最重要的配置文件,因为它关系到你的FTP服务器能否
正常工作,还有许多权限上的设定。下面来自/usr/doc/wu-ftp../example/:
class   all   real,guest,anonymous  *
limit   all   10   Any              /etc/msgs/msg.dead
readme  README*    login
readme  README*    cwd=*
message /welcome.msg            login
message .message                cwd=*
compress        yes             all
tar             yes             all
log commands real
log transfers anonymous,real inbound,outbound
shutdown /etc/shutmsg
email user@hostname

下面是说明:

loginfails 次数
设定允许用户有几次密码错误的机会。
class 类名 类别 (real,guest,anonymous)IP 地址
这个指令的功能是为设定Ftp服务器上用户的类别。
在Ftp服务器上的用户基本上可以发分为三类:
real : 在ftp服务器上属于有合法帐号的用户。
guest: 另外定义某些使用群组的用户
anonymous: 权限最低的匿名用户。

例如:

class remote real,guest,anonumous*
定义一个名为remote的类,里面有三种类型的用户,"*"代表网络上
的所有机器,也就是说,任何人都可以连到你这台ftp服务器上。如果
你想让某一个IP地址的机器或是某一个网段有特别的访问权限,则可以
这样做:

class local real,guest,anonumous *.zju.edu.cn 100.11.91.11

limit  类别   人数 时间 文件名
这个指令设置同一时间内允许连接的人数。

例如:limit local 20 any /etc/msgs/msg.toomany
      limit remote 100 SaSu|Any1800-0600  /etc/msgs/msg.toomany

msg.toomany内容可以为:
There is currently a limit of %M anonymous users.

ftp服务器可以识别的变量:

%T 本地时间
%F CWD所在分区的剩余空间。K为单位。不是所有系统支持。
%C 当前的工作目录
%E 管理员的e-mail地址
%R 远端主机名
%L 本地主机名
%U 用户名
%M 这个类别所允许的最大连接数目
%N 这个类别当前连接的数目

readme 说明文件 指令
当用户执行所设定的指令时,系统会显示所说明的说明文件

readme  README*    cwd=*
表示用户切换目录时,只要是以README打头的文件都会显示出来。

message 说明文件 指令
当用户执行所设定的指令时,系统会将文件的内容显示出来。

compress (yes/no) 类别
设定哪一个类别的用户可以使用compress功能。

例如: compress yes local remote

tar 与compress 类似

private (yes/no)
设定是否支持群组对文件的取用

private <yes|no>;
After user logs in, the SITE  GROUP  and  SITE  GPASS commands
may  be  used to specify an enhanced access group and associated
password.  If the group name and password  are valid, the user
becomes (via setegid()) a member of the group specified in the

group  access file /etc/ftpgroups.
passwd-check (none/trival/rfc822) (enforce/warn)

设定当用户使用anonumous帐号登陆时的密码使用方式,下面是个选项的说明

none 表示不做密码验证。
trival 任何包含"@"的密码就可以
rfc822 一定要符合rfc822的e-mail地址规格。
enfoce密码不符合不能登陆。
warn 密码不符合警告。

log commands 类别(real/guest/anoymous)
设定哪些用户登陆时,所使用的操作会被记录在/var/adm/xferlog里。

log transfers 类别(real/guest/anonumous) (inbound/outbound)
设定所指定的用户群组在上载(inbount)或是下载时有关的信息会记录到
/var/adm/xferlog中。

shutdown 文件名

  shutdown <path>;
   If the file pointed to by <path>; exists,  the  server will check
   the file regularly to see if the server is going to be shut down.
   If a shutdown is planned, the user  is notified, new connections
   are denied after a specified time before shutdown  and  current
   connections  are  dropped  at a specified time before shutdown.
   <path>; points to a file structured as follows:
   <year>; <month>; <day>; <hour>; <minute>; <deny_offset>; <disc_offset>;<text>;
             <year>; any year >; 1970
             <month>; 0-11 <---- LOOK!
             <hour>; 0-23
             <minute>; 0-59
            <deny_offset>;  and  <disc_offset>;  are the offsets in
            HHMM format before the shutdown time that new connec-
            tions will be denied and existing connections will be
            disconnected.
       <text>; follows the normal rules for any message (see "mes-
       sage", with the following additional magic cookies avail-
       able:
        %s      time system is going to shut down
            %r      time new connections will be denied
            %d      time current connections will be dropped
       all times are in the  form:  ddd  MMM  DD  hh:mm:ss  YYYY.
       There can be only one "shutdown" command in the configura-
       tion file.
    Ftp服务器关闭的时间可以设定在后面指定的文件中,设定的时间一到,便
    无法登陆到Ftp服务器上了,要恢复的话只有将这个文件删除。文件的格式可以
    由/etc/ftpshut来建立。

delete (yes/no) (real/anonymous/guest)
设定是否允许指定用户使用delete这个指令。
override
readme
chmod
umask
类似
upload 根目录 上载目录 (yes/no) 用户群组权限 (dirs/nodirs)
这个命令设定哪一个目录是可以上载文件的。

如:

upload /home/ftp /incoming yes root daemon 0600 dirs
表示/home/ftp是指定目录,在这个目录中只有incoming这个子目录可以上载文件,而上
载文件
的只有root用户而且群组上daemon,文件的操作权限是0600,也就是rw-------,dirs是指
可以在这个目录中建立子目录。

upload /home/ftp /bin no
upload /home/ftp /etc no
alias 目录别名 目录

例如: alias inc incoming

cdpath 目录
用于cd命令时的路径搜索
path-filter (read/anonymous/guest) 目录
设定上载时的文件名限制
guestgroup 功能
设定guest组的功能
例如: guestgroup ftponly
e-mail guest的e-mail地址
deny IP地址/域名 说明文件
设定限制哪一个IP地址或域名无法登入Ftp服务器
deny 192.192.69.* *.com.cn /etc/deny.msg
deny !nameserved /etc/deny.msg
这是一种比较特殊的用法,用来设定用户的IP地址必须由Reserve Domain的方式找到对
应的域名才
能连接到ftp服务器。

2./etc/ftpusers 和/etc/ftphosts的设定

/etc/ftpusers的设定是限制系统上的某些用户不能使用ftp传送文件,/etc/ftphosts的
设定是限制
某些主机不能连到你的Ftp服务器上。这样做的目的是为了系统的安全。

例子:

root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody

主要是避免1.权限过大的用户
     2.与命令名相同的用户
连到ftp服务器。

/etc/ftphosts的例子:

192.9.200.74 www.zju.edu.cn

3./etc/ftpconventions的设定

这个文件是用来设定当用户下载文件时应该做哪些操作,例如压缩,解压缩等。
:.Z:  :  :/bin/compress -d -c %s:T_REG|T_ASCII:O_UNCOMPRESS:UNCOMPRESS
:   : :.Z:/bin/compress -c %s:T_REG:O_COMPRESS:COMPRESS
:.gz: :  :/bin/gzip -cd %s:T_REG|T_ASCII:O_UNCOMPRESS:GUNZIP
:   : :.gz:/bin/gzip -9 -c %s:T_REG:O_COMPRESS:GZIP
:   : :.tar:/bin/tar -c -f - %s:T_REG|T_DIR:O_TAR:TAR
:   : :.tar.Z:/bin/tar -c -Z -f - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+COMPR
ESS
:   : :.tar.gz:/bin/tar -c -z -f - %s:T_REG|T_DIR:O_COMPRESS|O_TAR:TAR+GZIP
:.gz: :  :/bin/gzip -cd %s:T_REG|T_ASCII:O_UNCOMPRESS:GUNZIP
表示将所有的*.gz用gzip -cd的方式解压缩。
:   : :.gz:/bin/gzip -9 -c %s:T_REG:O_COMPRESS:GZIP
表示将所传送的文件压缩成*.gz
其实wu-ftp所附的文件已经够用,通常不需要修改。
到目前为止,已经安装好了一个匿名FTP服务器。

4.wu-ftp的相关程序

ftpcount 可以用来统计当前连接的用户数目,并给出上限。
ftpwho   查询当前连接的用户的详细情况。
ftpshut 重要功能是生成/etc/shutmsg
ftpshut <-l min>; <-d min>; time <说明>;
-l 这个参数设定在关闭Ftp服务器功能前多少分钟时停止用户的连接。
-d 这个参数设定在关闭Ftp服务器前多少分钟将用户断线。
Time:关闭时间。例如,0620 表示6时20分
<说明>; 可以输入最多75个字符。

论坛徽章:
0
2 [报告]
发表于 2003-01-28 01:07 |只看该作者

wu-ftpd简单配置

good!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP