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 :|

link|improve this question

Is SELinux enabled? .. "getenforce" – MIfe 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. – MIfe Nov 13 '11 at 7:18
feedback

1 Answer

up vote 2 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.

link|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
feedback

Your Answer

 
or
required, but never shown

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