2

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

Castaglia
  • 3,239
  • 3
  • 19
  • 40
adrianTNT
  • 1,007
  • 5
  • 21
  • 41

1 Answers1

3

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.

lzap
  • 2,704
  • 2
  • 22
  • 22
  • 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 01: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