WU-FTPd: Setting up and adding users

Installing WU-FTPd

  1. Get the RPM from www.rpmfind.net
  2. Edit /etc/ftpaccess

  3. class   all   guest  *
    guestgroup acme
    #Make sure the user account belongs to group ACME !
    email root@localhost
    loginfails 5
    greeting brief
    readme  README*    login *
    readme  README*    cwd=*
    message /welcome.msglogin
    message .messagecwd=*
    #compress        yes                  all
    #tar                  yes                  all
    chmod  no  guest
    delete  yes  guest
    overwrite  yes  guest
    rename  yes  guest
    log transfers anonymous,real inbound,outbound
    shutdown /etc/shutmsg
    passwd-check rfc822 warn
  4. Add an FTP-only shell to /etc/shells

  5. /etc/ftponly

Adding a user

    1. Log on to the FTP server as root
    2. In root's home directory, run ./ftpusradd.sh
    3. Lock this user to his FTP directory using /home/ftp/jdoe/./
    4. Note: As ./passwd is read-only, use :w! to perform a forced save
    5. As prompted, create a password for this user
    6. Test that the account works with "FTP FTP"

Removing a user

  1. Log on to the FTp server as root
  2. In root's home directory, run ./ftpusrdel.sh
  3. #!/bin/bash
  4. # ftpusradd.sh
    if [ "$1" = "" ] 
    then 
    echo "Syntax is ./ftpusradd user" 
    else 
            useradd -g acme -d /home/ftp/$1 -c "$1 FTP account" -s /etc/ftponly $1 
            chmod 0770 /home/ftp/$1 ;Needed to access directory through Samba 
            rm -Rf /home/ftp/$1/* 
            rm -Rf /home/ftp/$1/.??* 
            cp -dpR /home/bin /home/ftp/$1 
            cp -dpR /home/etc /home/ftp/$1 
            cp -dpR /home/.??* /home/ftp/$1 
            chmod 0644 /home/ftp/$1/etc/passwd 
            grep $1 /etc/passwd >> /home/ftp/$1/etc/passwd 
            chmod 0444 /home/ftp/$1/etc/passwd 
            vi /home/ftp/$1/etc/passwd 
            echo "WARNING: Remember to set a password for user $1!" 
    fi
    
    #!/bin/bash 
    # 
    # /root/ftpusrdel.sh 
    # 
    if [ "$1" = "" ] 
    then 
    echo "Syntax is ./ftpusrdel jdoe" 
    else 
    userdel $1 
    rm -Rf /home/ftp/$1 
    fi

Resources

More infos @ http://www.landfield.com/wu-ftpd/guest-howto.html