LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1857|回复: 5

ftp匿名服务无法访问挂载iso的目录

[复制链接]
发表于 2008-11-4 17:06:03 | 显示全部楼层 |阅读模式
Fedora Core 9 自带的vsftp 服务,已经安装并开启,能正常匿名访问。根目录为 /var/ftp 。
将iso文件拷贝到 /var/ftp/iso 下,能正常访问。
建立目录 /var/ftp/iso/disc ,并将DVD光盘文件 XXX.iso 挂载到该目录。
$ sudo mount -o loop XXX.iso /var/ftp/iso/disc
挂载成功后,可以在本地访问该目录下的内容。但通过匿名ftp服务,可以访问其他内容,但看不到 /var/ftp/iso/disc ,更无法访问目录内的内容。

请问该如何解决。谢谢。
 楼主| 发表于 2008-11-4 17:40:58 | 显示全部楼层
看了日志,好像是selinux的问题,但怎么搞呀
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-11-4 22:13:44 | 显示全部楼层
英文不太好,谁帮忙看看:

Summary:

SELinux is preventing vsftpd (ftpd_t) "getattr" to /fedora9/disc (iso9660_t).

Detailed Description:

SELinux denied access requested by vsftpd. It is not expected that this access
is required by vsftpd and this access may signal an intrusion attempt. It is
also possible that the specific version or configuration of the application is
causing it to require additional access.

Allowing Access:

Sometimes labeling problems can cause SELinux denials. You could try to restore
the default system file context for /fedora9/disc,

restorecon -v '/fedora9/disc'

If this does not work, there is currently no automatic way to allow this access.
Instead, you can generate a local policy module to allow this access - see FAQ
(http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385) Or you can disable
SELinux protection altogether. Disabling SELinux protection is not recommended.
Please file a bug report (http://bugzilla.redhat.com/bugzilla/enter_bug.cgi)
against this package.

Additional Information:

Source Context                system_u:system_r:ftpd_t:s0
Target Context                system_ubject_r:iso9660_t:s0
Target Objects                /fedora9/disc [ dir ]
Source                        vsftpd
Source Path                   /usr/sbin/vsftpd
Port                          <Unknown>
Host                          office.test.com
Source RPM Packages           vsftpd-2.0.6-6.fc9
Target RPM Packages           
Policy RPM                    selinux-policy-3.3.1-103.fc9
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   catchall_file
Host Name                     office.test.com
Platform                      Linux office.test.com 2.6.26.6-79.fc9.i686 #1
                              SMP Fri Oct 17 14:52:14 EDT 2008 i686 i686
Alert Count                   4
First Seen                    2008年11月04日 星期二 09时40分19秒
Last Seen                     2008年11月04日 星期二 21时49分50秒
Local ID                      0f8e9851-b617-4c24-a207-c7f94107e0c1
Line Numbers                  

Raw Audit Messages            

host=office.test.com type=AVC msg=audit(1225806590.759:47): avc:  denied  { getattr } for  pid=5960 comm="vsftpd" path="/fedora9/disc" dev=loop0 ino=1856 scontext=system_u:system_r:ftpd_t:s0 tcontext=system_ubject_r:iso9660_t:s0 tclass=dir

host=office.test.com type=SYSCALL msg=audit(1225806590.759:47): arch=40000003 syscall=196 success=no exit=-13 a0=b85005b8 a1=b8500550 a2=316ff4 a3=b80a013c items=0 ppid=5958 pid=5960 auid=4294967295 uid=14 gid=50 euid=14 suid=14 fsuid=14 egid=50 sgid=50 fsgid=50 tty=(none) ses=4294967295 comm="vsftpd" exe="/usr/sbin/vsftpd" subj=system_u:system_r:ftpd_t:s0 key=(null)
回复 支持 反对

使用道具 举报

发表于 2008-12-13 18:45:21 | 显示全部楼层
建议你将selinux关闭,后重启VSFTP  再访问
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-1-7 13:16:56 | 显示全部楼层
已解决,参考:
http://416142329.qzone.qq.com/
回复 支持 反对

使用道具 举报

发表于 2009-1-14 16:11:35 | 显示全部楼层
搞Samba的时候,Selinux也折腾了我半天
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表