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 can't make vsftpd to work and it is driving me crazy. The virtual users can connect, but they can't upload files or create folders. I hope someone can help me.

I get this error in the ftp client:

553 Could not create file

And this is the error in /var/log/messages

Jul 11 12:51:41 appserver kernel: type=1400 audit(1373557901.832:17): avc:  denied  { write } for  pid=3705 comm="vsftpd" name="usr00" dev=dm-0 ino=2097155 scontext=unconfined_u:system_r:ftpd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:default_t:s0 tclass=dir

This is my vsftpd.conf:

pasv_enable=NO
pam_service_name=vsftpd
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
nopriv_user=vsftpd
virtual_use_local_privs=YES
guest_enable=YES
user_sub_token=$USER
local_root=/ftp/$USER
chroot_local_user=YES
hide_ids=YES
guest_username=vsftpd

This is my selinux configuration:

allow_ftpd_anon_write --> off
allow_ftpd_full_access --> off
allow_ftpd_use_cifs --> off
allow_ftpd_use_nfs --> off
ftp_home_dir --> on
ftpd_connect_db --> off
ftpd_use_passive_mode --> off
httpd_enable_ftp_server --> off
tftp_anon_write --> off

The test user is usr00. There is a folder /ftp/usr00 :

ls -Z /ftp
drwxr-xr-x. vsftpd vsftpd unconfined_u:object_r:default_t:s0 cg00
share|improve this question

1 Answer 1

up vote 1 down vote accepted

have you tried setting public_content_rw_t SELinux contest on the ftp rw dir? Or is there any reason why you don't want to do that?

chcon -t public_content_rw_t /ftp
ls -lZ /ftp
share|improve this answer
    
Thanks Petter, that was it. I also had to set allow_ftpd_anon_write to true and it worked. –  Pleonc Jul 11 '13 at 17:44

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.