Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to allow users to upload files to an FTP server anonymously. They should not be able to see any other files, or download files. It is a CentOS 5.2 server. I have a separate partition for the the upload area (mounted at /ftp).

I have tried to set up vsftpd, followed all the instructions/advice I could find. But, when a user logs in and tries to transfer a file it throws a "553 could not create file." error. If I do a 'pwd' it shows the directory as "/" rather than the anon_root of "/ftp/anonymous". Any attempt to change the remote directory ends with "550 Failed to change directory.". I have a subdirectory "/ftp/anonymous/incoming" that is writable for the uploads

SELinux is in permissive mode.

I am running version 2.0.5 release 16.el5 of vsftpd.

Here is the vsftpd.conf file:

anonymous_enable=YES  
local_enable=YES  
write_enable=YES  
local_umask=002  
anon_umask=007  
file_open_mode=0666  
anon_upload_enable=YES  
anon_mkdir_write_enable=NO  
dirmessage_enable=YES  
xferlog_enable=YES  
connect_from_port_20=YES  
chown_uploads=YES  
chown_username=inftpadm  
xferlog_std_format=YES  
nopriv_user=nobody  
listen=YES  
pam_service_name=vsftpd  
userlist_enable=YES  
tcp_wrappers=YES  
ftp_username=inftpadm  
anon_root=/ftp/anonymous  
anon_other_write_enable=NO  
anon_mkdir_write_enable=NO  
anon_world_readable_only=NO  
dirlist_enable=YES  

Can anyone help?

share|improve this question
    
I was able to allow ls and cd to work by adjusting directory permissions. But, the 553 error is still there. –  Craig Dec 2 '09 at 14:18

2 Answers 2

up vote 0 down vote accepted

The configuration file is pretty straightforward. Here's where you're going wrong:

anon_mkdir_write_enable=NO  
listen=YES   
anon_other_write_enable=NO  
anon_mkdir_write_enable=NO 

You have an entry duplicated (which shouldn't be a big deal), and you have anon_other_write_enable set to NO. Also, if you're going to use the second line, make sure you have the service disabled in inetd/xinetd.

After changing the SELinux context you also need to reboot to relabel the file system. Run sestatus to see the current context.

share|improve this answer

I know it's a basic question, but did you check directory ownership and permissions? If so, could you show them with an "ls -al"?

share|improve this answer
    
drwxr-xr-x 4 root root 4096 Nov 30 13:34 /ftp drwxr-xr-x 3 root root 4096 Nov 30 15:52 /ftp/anonymous/ drwxrwxrwx 2 root root 4096 Dec 1 14:48 /ftp/anonymous/incoming/ –  Craig Dec 2 '09 at 14:17
    
Just to be thorough, did you run "getenforce" and ensure that SELinux is definitely in permissive mode currently (vs say set to permissive for the next reboot). Also ensure that there isn't already a file in the directory with that name because based on the vsftpd.conf settings above anonymous would not be able to upload over an existing file. –  Brian Dec 2 '09 at 17:18
    
It's definately in permissive mode. And, I don't want anonymous to overwrite files. The directory is currently empty. –  Craig Dec 2 '09 at 21:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.