RH7.2 anonymous ftp upload setup 

init 

cd /
ln -s /var/ftp
cd /ftp
mkdir -p incoming/tong
chown ftp:crew -R incoming
cd /opt
md conf/ftp

Steps 

cd /opt/conf/ftp
cat ftpaccess* > /etc/ftpaccess
cp welcome.msg /ftp/etc/
chown ftp /ftp/etc/welcome.msg
[Tip]

!!

ncftpput -d -v localhost /incoming ~/s/docs/file.sample.bin
ncftpput -d -v localhost /incoming/tong ~/s/docs/file.sample.bin

Trying history 

Use abs dir 

$ ll /ftp
/ftp -> /var/ftp

in ftpaccess:

upload  /ftp    /incoming       yes
upload  /var/ftp    /incoming       yes

Upload will only work if the 2nd line is added.

ftpaccess 

This is the finial text version of ftpaccess. I'll use the kwuftpd to configure it from now on.

Note that kwuftpd 0.2.0 has some obvious bugs:

  • having problems displaying upload controls. But the content are ok.
  • The output of limitation is wrong. Thus unusable.
# This file controls the behavior of the wu-ftpd
# ftp server.
#
# If you're looking for a graphical frontend to
# editing it, try kwuftpd from the kdeadmin
# package.

# == Account setup

#only allow anonymous users -- no other classes defined
class anonftp anonymous *
autogroup crew anonftp

# Don't allow system accounts to log in over ftp
deny-uid %-99 %65534-
deny-gid %-99 %65534-
allow-uid ftp
allow-gid ftp

#anonymous-root /var/ftp
defumask        0644
defumask        0660    anonftp

# The ftpchroot group doesn't exist by default, this
# entry is just supplied as an example.
# To chroot a user, modify the line below or create
# the ftpchroot group and add the user to it.
#
# You will need to setup the required applications
# and libraries in the root directory (set using
# guest-root).
#
# Look at the anonftp package for the files you'll need.
guestgroup ftpchroot


# == Messages & loggings

greeting        full
banner          /opt/conf/ftp/banner.msg

# Messages displayed to the user upon login/cd
message         /opt/conf/ftp/welcome.msg       login
message         .message                cwd=*

# Notify the users of README files at login and when
# changing to a different directory
readme  README*    login
readme  README*    cwd=*

# Turn on logging to /var/log/xferlog
log     transfers       anonymous,guest,real    inbound,outbound
log     security        anonymous,real

# == Settings

email   root@sunny

#fast cd and aliasing for the same reason
alias   inc:    /incoming
cdpath  /pub/installs
cdpath  /pub
cdpath  /incoming
cdpath  /

# == file transmission

# Allow on-the-fly compression and tarring
compress        yes             all
tar             yes             all

# file operations control
# Prevent anonymous users (and partially guest users)
# from executing dangerous commands
chmod           no              guest,anonymous
umask           no              anonymous,guest
delete          no              anonymous
overwrite       no              anonymous
rename          no              anonymous

# == Limitations

# If /etc/shutmsg exists, don't allow logins
# see ftpshut man page
shutdown        /opt/conf/ftp/shutdown.msg

# Ask users to use their email address as anonymous password
passwd-check    rfc822  enforce
#loginfails 3  # no need for anonymous users

#what is allowed in paths
#path-filter    anonymous       /opt/conf/ftp/path.msg  ^[-A-Za-z0-9_\./ ]*$    ^\.     ^-

noretrieve .notar

#number of users restriction with message shown when too many
limit   anonftp 4       Any     /opt/conf/ftp/toomany.msg
limit           5       Any     /opt/conf/ftp/toomany.msg

file-limit      total   8
private         no

# == upload control
upload  /var/ftp        *               no
upload  /var/ftp    /incoming       yes     ftp     crew    0664    nodirs
upload  /var/ftp    incoming/*      yes     ftp     crew    0664    dirs    0750
upload  /var/ftp    incoming/*/*    yes     ftp     crew    0664    nodirs

upload  /var/ftp        /private/*/incoming     yes * crew 0640 dirs    0750

#prevent anon users to GET files from incoming, a good idea to prevent some
#people from using your ftp server to store their own stuff, pics, warez etc.
#ideas from <ftp://ftp.wu-ftpd.org/pub/wu-ftpd/upload.configuration.HOWTO>[]

noretrieve /var/ftp/incoming

help 

shutdown 

Running command ftpshut will create a file that the server will use to determine when to shutdown. Once the shutdown has occured, the server will continue to refuse connections until this file is removed. The location of this file is specified by the shutdown stanza in the ftpaccess file.