Hi!
I was pretty frustrated again when it took me days without getting it to work as well...people keep on saying it's a problem with permissions conflicts between the actual directories and the config file, but it just isn't. Of course as with all things, once you finally know them, it makes sense.
A good how-to I reckon is:
http://ubuntuforums.org/showthread.php?t=51611
I've solved the anonymous problem with the following setup (ftp_login might not have been a good name after all, but it works):
Since you wouldn't want the ftp user you create to have a valid login shell, it should be save to have the user without a password. So what I did was creating a user like this (o and I just assume you are superuser (sudo -s)):
Code:
useradd ftp_login -p your_password -d /home/ftp -s /bin/false
When done this the user will probably be locked since it has no password yet, and since we don't want a password, we can unlock it by:
Code:
passwd -u ftp_login
Now I made a directory called temp in the home directory of ftp_login:
Code:
cd /home
mkdir ftp_login/temp
Just to be sure the permissions of the folders are right:
Code:
chmod 755 ftp_login
chmod 777 ftp_login/temp
After that I scrabled some configuration files together as this /etc/proftpd/proftpd.conf
Code:
# This configuration establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anonymous access.
ServerName "the ftp server"
ServerType standalone
DefaultServer on
RequireValidShell off
AuthPAM off
AuthPAMConfig ftp
# Port 21 is the standard FTP port.
Port 21
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022
# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit the maximum number of processes per service
# (such as xinetd).
MaxInstances 30
#Allow resume download / upload (?)
AllowStoreRestart on
PersistentPasswd off
# Set /home/FTP-shared directory as home directory
DefaultRoot /home/ftp_login
# Lock all the users in home directory, ***** really important *****
DefaultRoot ~
# Set the user and group under which the server will run.
User nobody
Group nobody
DirFakeUser on nobody
DirFakeGroup on nobody
# Valid logins
<Limit LOGIN>
AllowUser ftp_login
DenyALL
</Limit>
UserAlias anonymous ftp_login
<Directory />
AllowOverwrite off
<Limit MKD STOR DELE XMKD RNRF RNTO RMD XRMD>
DenyAll
</Limit>
</Directory>
<Directory ~/>
Umask 022 022
AllowOverwrite off
</Directory>
<Directory ~/temp/>
Umask 022 022
AllowOverwrite off
<Limit READ RMD DELE>
DenyAll
</Limit>
<Limit STOR CWD MKD>
AllowAll
</Limit>
</Directory>
So how this actually works: an anonymous visitor connects to the ftp server, tries to log in as user anonymous, the server converts it to ftp_login because of the UserAlias line, and for this user is no password set so anonymous will be allowed without!
I liked the comment in the mentioned post on the syntax check to test the configuration file:
Hope it works for you!