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 have Centos 6.0 and installed vsftp with YUM, I added a user with Webmin panel, set its home dir to "/var/www/html" and its shell to "/bin/sh", user id is 500, user group is same as name: "adrian_ftp".

When I start a ftp program it logs in but the remote folder always shows empty. I set directory owner and group to adrian_ftp:adrian_ftp , no change, I also made them 0777, no change.

Any ideas? I tried for over 3-4 hours :|

share|improve this question
    
Is SELinux enabled? .. "getenforce" –  Matthew Ife Nov 12 '11 at 21:20
    
it says Enforcing –  adrianTNT Nov 13 '11 at 1:46
    
Restart httpd, then try your ftp user, try to list a directory, then run "ausearch -ts recent -m avc" and provide the results. –  Matthew Ife Nov 13 '11 at 7:18

1 Answer 1

up vote 3 down vote accepted

It's selinux for 99 % ;-)

# getenforce
Enforcing

Turn it off by:

# setenforce 0
# vim /etc/sysconfig/selinux

And set it to "disabled" in that file or "permissive" if you plan to turn it on sometime in future or you want to track selinux errors.

For FTP I highly recommend NOT to turn it off. Follow the RHEL 6 guides how to set it up properly for a FTP site.

share|improve this answer
    
can you give me more info please? It says Enforcing , httpd won't start after I set setenforce to 0/1 –  adrianTNT Nov 13 '11 at 1:46
    
It was* the selinux that is messing the FTP, I lost too many hours with it already so I just disabled it. I see it is also disabled on other servers. –  adrianTNT Nov 13 '11 at 12:49
    
Disabled selinux and set in vsftpd.conf this: chroot_local_user=YES to keep user in its own directory. –  adrianTNT Nov 13 '11 at 13:05
2  
So you succeeded, that's good. I still recommend to run FTP in the selinux mode. You will need to tag directories for selinux - see any selinux guide (RHEL 6 documentation is the best source). –  lzap Nov 14 '11 at 12:58
    
OK... Thank you. –  adrianTNT Nov 15 '11 at 13:22

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.