Wu-ftpd comes with built in support to make it virtual. However, you
cannot maintain separate password files for each domain. For example, if
bob@domain1.com
and bob@domain2.com
both want
an account you would have to make one of them bob2 or have one of
the users choose a different user name. Since you now have a virtual
filesystem for each domain you have separate password files and this
problem goes away. Just create a virtnewuser script and a virtpasswd
script in the way mentioned above and you are all set.
The inetd.conf entries for wu-ftpd:
ftp stream tcp nowait root /usr/local/bin/virtuald \ virtuald /virtual/conf.ftp wu.ftpd -l -a
These are unaffected by the virtuald setup. For an anonymous user just create the FTP user in /virtual/domain1.com/etc/passwd like you would normally.
ftp:x:14:50:Anonymous FTP:/var/ftp:/bin/false
Then setup the anonymous FTP directory. You have separate password files for
each domain so you can restrict which domain has an anonymous
FTP account. Please note that since the FTP server is already chrooted
into the /virtual/domain1.com directory you do not have to prefix any
paths with it.
Wu-ftpd supports something called a guest group. This allows you
to create different FTP areas for each user. The FTP server does
a chroot
to the specified area so the user cannot go
outside that directory tree. If you create the users within a
virtual domain this way they will not be able to view the
system files.
Add the guest's group to the /virtual/domain1.com/etc/ftpaccess file.
Create an entry in /virtual/domain1.com/etc/passwd with the chroot
dir and the starting home directory separated by /./
:
guest1:x:8500:51:Guest FTP:/home/g/guest1/./incoming:/bin/false
Then setup guest's home like you would for anonymous FTP. You have separate
password files for each domain so you can specifiy which domains have guest
accounts and which users within a domain are guest users. Please note that since
the FTP server is already chrooted
into the /virtual/domain1.com directory you do
not have to prefix any paths with it.