I have added more detailed explanation and steps into the proftpd
section,
and fixed the punctuation marks in the html.
Please use the attached html to replace your copy if it'ok.

-- 
May the Force and Farce be with Linux and you.
Join the friendly chit-chat in http://www.linux-sxs.org &
news://news.hkpcug.org
Title: Installing ProFTPd
Linux Step By Steps

Installing ProFTPD

From: Chang

Date: 17 March, 2002

This document describes the compile/install and configuration of a very basic ProFTPD service.

Grab the proftpd-1.2.4.tar.gz from Proftpd website. I am using Caldera OpenLinux 3.1, so I configured the package with these switches, and use checkinstall-1.5.1 to turn the package into an regular RPM for installation:

./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/run
make -j 3
checkinstall -si make install

NOTE: checkinstall-1.5.1 would require you to enter the path to Caldera's RPM repository in /usr/src/OpenLinux.

Then I wrote the /etc/proftpd.conf by reading the /usr/src/proftpd-1.2.4/doc directory. My proftpd exhibits the following characteristics:

  • unlimited no. of uses can always upload
  • 3 users can download at any time, with bandwidthlocked at 20000 kb/s.
  • all uploads go to /home/ftp, and on one can download from it.
  • users can download from /home/ftpdown only, and only for files
  • No users can login their home directory (well, I havne't learnt how to do it. :)
  • by defaults, files owned by ftp:ftp cannot be downloaded by anyone. To allow files to be downloaded, chown nobody:nobody the_file
  • chmod 753 /home/ftp; chown ftp:ftp /home/ftp
  • chmod 555 /home/ftpdown; chown nobody:nobody /home/ftpdown
  • The anonymous account is linked to a real user account ftp in /etc/passwd, with shell set to /bin/false.
  • for uploading, users punch in ftp://111.222.333.444
  • for downloading, users punch in ftp:[EMAIL PROTECTED]

Proftpd generates a log file that's similar to the log file wu-ftpd. That means, you can use the xferstats script from wu-ftpd to analyze the log. I put the xferstats script in /usr/sbin.

Note that xferstats script cannot handle non-ASCII file names properly and would give you a divide-by-zero error. When I saw that, I would eelete the log entries. Hope someone could teach me how to fix the xferstats script.

# beginning of proftpd.conf
ServerName	"Anonymous Server"
ServerType	standalone

# Port 21 is the standard FTP port.
Port                            21

# If you don't want normal users logging in at all, uncomment this
# next section
<LIMIT LOGIN>
  DenyAll
</LIMIT>
# Set the user and group that the server normally runs at.
User                            nobody
Group                           nogroup

MaxInstances                    10

# Set the maximum number of seconds a data connection is allowed
# to "stall" before being aborted.
TimeoutStalled                  300

UseFtpUsers                     off
RootLogin                       off
IdentLookup                     off
# you may want to have a separate file from the regular /etc/passwd
#AuthUserFile                   /etc/proftpd-passwd

<Global>
  Umask                         022
  MaxClientsPerHost             1 "One connection per IP"
  RequireValidShell             off
  DirFakeGroup                  on      nobody
  DirFakeUser                   on      nobody
  DirFakeMode                   0440
</Global>

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

<Anonymous /home/ftpdown>
  <Limit LOGIN>
    AllowAll
  </Limit>
  UserAlias                     download ftp
# cli-crypt-1.0.tar.gz is a package that can be downloaded from http://freshmeat.net, 
# basically written for use with proftpd.
# UserPassword                  download cli-crypt("password")
# AnonRequirePassword           on
  RequireValidShell             off
  MaxClients                    3 "550 Too Many Users (Limit=%m)"
  User                          ftp
  Group                         ftp
# you may not like the bandwidth control below
  RateReadBPS                   20000
  <Limit WRITE>
    DenyAll
  </Limit>
</Anonymous>

<Anonymous /home/ftp>
  <Limit LOGIN>
    AllowAll
  </Limit>
  UserAlias                     anonymous ftp
  User                          ftp
  Group                         ftp
  RequireValidShell             off
  AllowStoreRestart             on
  AllowOverwrite                on
  AllowForeignAddress           on
  <Limit REST STOR MKD APPE>
    AllowAll
  </Limit>
  <Limit RMD RNFR RNTO RETR DELE>
    DenyAll
  </Limit>
# Reject all files with leading periods or dashes:
  PathDenyFilter "(^|/)[-.]"
</Anonymous>
# end of proftpd.conf

For your convinience, here's my /etc/logrotate.d/ftpd for Proftpd's logs:

# beginning of /etc/logrotate.d/ftpd
missingok

/var/log/xferlog {
  size=256k
  nocopytruncate
  postrotate
    /usr/bin/killall -HUP syslogd
  endscript
}

/var/log/ftp {
  daily
  rotate 7
  postrotate
    /usr/bin/killall -HUP syslogd
  endscript
}
# end of /etc/logrotate.d/ftpd

Reply via email to