WU-FTPd: Setting up and adding users
Installing WU-FTPd
- Get the RPM from www.rpmfind.net
- Edit /etc/ftpaccess
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
-
Add an FTP-only shell to /etc/shells
/etc/ftponly
Adding a user
-
Log on to the FTP server as root
-
In root's home directory, run ./ftpusradd.sh
-
Lock this user to his FTP directory using /home/ftp/jdoe/./
-
Note: As ./passwd is read-only, use :w! to perform a forced save
-
As prompted, create a password for this user
-
Test that the account works with "FTP FTP"
Removing a user
-
Log on to the FTp server as root
-
In root's home directory, run ./ftpusrdel.sh
-
#!/bin/bash
# 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