精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>电脑技术>>● Linux>>Linux之配置篇>>利用SAMBA+PROFTPD建立大容量FTP站点..

主题:利用SAMBA+PROFTPD建立大容量FTP站点..
发信人: cngzwing(碌噶@失恋英雄)
整理人: skybird(2002-03-05 08:30:41), 站内信件
众所周知SAMBA是一个能够和WINDOWS共享文件及打印机的好软件基本上
REDHAT的6.0以上的版本都有,当然能够下载一个最新的就用最新吧..
这里关于SAMBA的设置我就不讲了,
samba http://www.samba.org
proftpd http://www.proftpd.org
好了,我的实现是这样的,我有两台机器一台是Linux系统用于NAT代理上网,另一台是PIII,自己用的啦.. 在LINUX装上了SAMBA和PROFTPD后,可以开到文件共享和FTP了,但由于LINUX机只有5G空间,不够用啊!怎么做FTP啊.. 两个电影就可以
把我撑爆啦...而PIII机器有40G空间除去系统和一些自己的软件外还有20G剩.
好,那就拿10G出来做FTP吧,大家都知道WINDOWS可以在本地网络做文件共享吧.
把目录共享出来,访问路径例如//Anthont-xp/share  这里的share是我共享的
目录名,OK,在LINUX下mount这个目录就要用以下命令了..
[root@iins /root]# mount -t smbfs //Anthony-xp/share /opt/ftp/incoming
那么这个目录就只有本地可以写,而通过FTP就只有读.那么要实现读写就要这样
例如我的FTP目录是这样的
drwxr-xr-x    1 ftp      ftp          4096 Feb 26 14:47 incoming
drwxr-xr-x    1 root     root         4096 Jan 13 13:52 linux
drwxr-xr-x    1 root     root         4096 Feb  9 13:52 mirror1
drwxr-xr-x    1 root     root         4096 Nov 21 20:55 mp3
drwxr-xr-x    1 root     root         4096 Dec  3 20:41 mtv
drwxr-xr-x    2 root     root         4096 Feb 21 10:29 pub
drwxr-xr-x    1 root     root         4096 Feb 26 09:41 software
-rw-r--r--    1 root     root          516 Feb 26 14:47 welcome.msg
其中里面的incoming,linux,mirror1,mp3,mtv,software,都是映射PIII主机的.
而我想incoming能读写,首先最基本就是WINDOWS里共享incoming文件夹时一定
是设置成完全访问.然后注意启动proftpd的用户名和组是要和incoming一致
而MOUNT目录就和刚才的不同了.要用以下命令..
[root@iins ftp]# mount -t smbfs -o uid=ftp,gid=ftp //Anthony-xp/incoming /opt/ftp/incoming
好! 大工告成,进入自己的FTP试试在incoming目录里创建新目录吧..
最后附上我自己的PROFTPD设置文件:

# 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                      "IINS.NET ProFTPD FTP Server"
ServerType                      standalone
DefaultServer                   on
DefaultRoot ~
ServerIdent                     off

# 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)
MaxInstances                    30

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

# Normally, we want files to be overwriteable.
<Directory /*>
  AllowOverwrite                on
</Directory>

# A basic anonymous configuration, no upload directories.
<Anonymous /opt/ftp>
  User                          ftp
  Group                         ftp
  # We want clients to be able to login with "anonymous" as well as "ftp"
  UserAlias                     anonymous ftp

  # Limit the maximum number of anonymous logins
  MaxClients                    10 "服务器忙,请稍后再试"
  MaxClientsPerHost             2 "来自同一IP的人只允许2个连接"
  # We want 'welcome.msg' displayed at login, and '.message' displayed
  # in each newly chdired directory.
  DisplayLogin                  welcome.msg
  DisplayFirstChdir             .message
  RequireValidShell             no
  # Limit WRITE everywhere in the anonymous chroot
<Directory />
    <Limit WRITE>
       DenyAll
    </Limit>
</Directory>

<Directory incoming/>
<Limit WRITE>
  AllowAll
</Limit>
</Directory>

</Anonymous>



----
Internet Informations Services
http://gzcs.dhcn.net/forum 

[关闭][返回]