荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: Pazu (自大狂的教训), 信区: Linux
标  题: proftp的安装
发信站: BBS 荔园晨风站 (Fri Jan 28 12:17:01 2000), 转信


       上次给那个坏的WU-FTP搞到我焦头烂额,换了个PROFTP,是比WU好用,而且快了,贴
 kxn的文章给大家看看.


ProFTPD 是又一个 FTP Daemon, 与 最流行的wu-ftpd相比, 它的好处有:

1. 配置文件类似Apache, 清晰易懂;
2. 提供standalone模式;
3. 内建ls, 无需像wuftpd那样要外部ls支持;
4. 还有很多好的特性, 如可以轻松限制同一IP的连接数, 等等.

以上是我个人的一点体会. ProFTPD是遵循GPL协议开发的, 你可以在很多地方找得到.

安装ProFTPD不难:

1. 抓到 proftpd-1.20XXXXXXX.tar.gz, 目前最新版本是 1.20pre3
2. tar zxvf proXXXXXXXX
3. cd proftpdXXXXX
4. ./configure
5. make
6. make install

安装完成. 缺省配置文件在 /usr/local/etc/proftpd.conf

然后是替换掉 wuftpd:

1. 编辑 /etc/inetd.conf, 找到下面这行
ftp  stream  tcp nowait  root /usr/sbin/tcpd  in.ftpd(此处可能不同) -l -i -a
把它注释掉;

2. killall in.ftpd (或 killall wu.ftpd, 依上面那行中写的为准)
不过, 如果你的机器上还连了好几十号的人的话, 在动屠刀前考虑一下他们的感受先...

3. /usr/local/sbin/proftpd

4. 在 /etc/rc.d/rc.local 中最后一行也加入
   /usr/local/sbin/proftpd

好了, 现在就可以ftp上去看看了.

下面是 202.115.16.8 的配置文件, 包括限制 anonymous 的权限, 以及个人主页用户
目录的限制.

[警告]
因照抄本配置文件之全部或部分而可能导致的任何数据, 设备或人员损失, 如文件坏掉,
硬盘当掉, MM跟大款跑掉等等, 概与本文作者无关.

# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName                      "ProFTPD"
ServerType                      standalone
# 嘿嘿, 下面这行不要照抄的说...
ServerAdmin                     rick@cs.uestc.edu.cn
DefaultServer                   on

# Port 21 is the standard FTP port.
Port                            21
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                           022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
# 设置最大连接数为100
MaxInstances                    100

# Set the user and group that the server normally runs at.
User                            nobody
Group                           nobody

# Normally, we want files to be overwriteable.
<Directory /*># This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use.  It establishes a single server
# Normally, we want files to be overwriteable.
<Directory /*>
  AllowOverwrite                on
</Directory>

# 这一行就完成了个人主页用户访问目录的限定. 意思是 ftponly 组的用户
# 只能通过ftp访问他们自己的目录. 如果你用的是别的组, 那就写别的组.
DefaultRoot ~ ftponly

# A basic anonymous configuration, no upload directories.
<Anonymous ~ftp>
  User                          ftp
  Group                         ftp

  RequireValidShell             off
  # We want clients to be able to login with "anonymous" as well as "ftp"
  UserAlias                     anonymous ftp

  # 限制同一IP最大连接数为3, say goodbye, netants...
  MaxClients                    100
  MaxClientsPerHost             3

  # We want 'welcome.msg' displayed at login, and '.message' displayed
  # in each newly chdired directory.
  DisplayLogin                  welcome.msg
  DisplayFirstChdir             .message

  # Limit WRITE everywhere in the anonymous chroot
  <Limit WRITE>
    DenyAll
  </Limit>

  <Directory incoming/*>
    <Limit STOR>
      AllowAll
    </Limit>
    <Limit MKD>
      AllowAll
    </Limit>
  </Directory>

</Anonymous>

好了.
That's all, folks. Enjoy you job...



--
※ 来源:·BBS 荔园晨风站 bbs.szu.edu.cn·[FROM: 192.168.32.189]


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店