Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am having problems to allow anonymous FTP access to a directory that mounted a ISO file.

  • No change to /etc/vsftpd/vsftpd.conf
  • RHEL 6.5 DVD ISO file saved to /var/ftp/pub/ISO/rhel6_5.iso
  • Anonymous user can see this ISO file
  • Created a directory /var/ftp/pub/rhel
  • Mounted iso file, mount -o loop,ro /var/ftp/pub/ISO/rhel6_5.iso /var/ftp/pub/rhel

But anonymous ftp users can't see rhel directory for some reason, any ideas ?

I followed this instructions vsftpd symbolic link, but it did not work for me. /var/ftp/pub/rhel directory will disappear from anonymous FTP user, if I mount the ISO file.

Here is ls -lZ output. I also noticed that SELinux context will change once I mount the ISO file.

[root@citest pub]# ls -lZ
drwxr-xr-x. root root unconfined_u:object_r:public_content_t:s0 ISO
drwxr-xr-x. root root unconfined_u:object_r:public_content_t:s0 rhel
share|improve this question
    
What permission have the /var/ftp/pub/rhel directory? –  Braiam Jul 3 at 2:27

1 Answer 1

After about 3 hours, I think I figured out why it is not working.

Selinux context public_content_t is required for files shared via an FTP server, unless associated with a user home directory and looks like /var/ftp/pub does not qualify for home directory.

After I mounted ISO file, the security context of rhel changed to system_u:object_r:iso9660_t:s0 and also because ISO file can only be mounted as read only, I could not change security context.

Also noticed following in /var/log/audit/audit.log

type=AVC msg=audit(1404397698.292:182): avc:  denied  { getattr } for  pid=2671 comm="vsftpd" path="/pub/ISO/rhel" dev=loop1 ino=1856 scontext=unconfined_u:system_r:ftpd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:iso9660_t:s0 tclass=dir

Disabled selinux and restarted vsftpd, all working fine.

share|improve this answer

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.