为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

LINUX: Can't access files outside of home directory

  • 8 个回答
  • 2 人有此问题
  • 4 次查看
  • 最后回复者为 cor-el

more options

OS: Linux localhost.localdomain 3.10.0-693.11.1.el7.x86_64 #1 SMP Mon Dec 4 23:52:40 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux FireFox: 52.5.1 (64-bit)

I'm trying to access my build directory /lfsbuild/sources/gcc-7.2.0/INSTALL. The file permission permit read/write access however I get

Access to the file was denied The file at /lfsbuild/sources/gcc-7.2.0/INSTALL/build.html is not readable.

   It may have been removed, moved, or file permissions may be preventing access.

The ONLY documents that I can open is when I copy them to my /home/whojr directory.

Can you please tell me how to resolve this issue.

SELinux status is enabled.

Thanks,

Bill

OS: Linux localhost.localdomain 3.10.0-693.11.1.el7.x86_64 #1 SMP Mon Dec 4 23:52:40 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux FireFox: 52.5.1 (64-bit) I'm trying to access my build directory /lfsbuild/sources/gcc-7.2.0/INSTALL. The file permission permit read/write access however I get Access to the file was denied The file at /lfsbuild/sources/gcc-7.2.0/INSTALL/build.html is not readable. It may have been removed, moved, or file permissions may be preventing access. The ONLY documents that I can open is when I copy them to my /home/whojr directory. Can you please tell me how to resolve this issue. SELinux status is enabled. Thanks, Bill

所有回复 (8)

more options

Not specifically firefox related, but you need execute and read permissions for the top level directories in order to access bottom directories. You should check to see if the user has those permissions on /lfsbuild, /lfsbuild/sources, /lfsbuild/sources/gcc-7.2.0, and also /lfsbuild/sources/gcc-7.2.0/INSTALL/.

An easy way to fix it is to use find and chmod: "find /lfsbuild -type d -exec chmod 755 {} \;"

Be aware this will recursively set all directories under lfsbuild to 755 permissions.

more options

Great thanks for checking all the bases but that was the first thing I checked. The permissions for the entire directory tree permits (readable and executable) access. I can navigate to the directory containing the files through firefox. I just can't open any of the html files even though I can use nano, vi, and emacs on them.

I also can't open any file on the system that is NOT under my home directory.

more options

You can check for sandbox security related issues.

You can set this pref to 2 or 1 on the about:config page to lower the sandbox security setting.

  • security.sandbox.content.level = 1
  • close and restart Firefox to make the change effective.

If '1' still doesn't have effect then try '0' to disable the sandbox.

If this didn't work then undo/reverse the change and reset the pref via the right-click context menu to the default value.

You can open the about:config page via the location/address bar. You can accept the warning and click "I accept the risk!" to continue.

more options

So to access files on my system using FireFox requires me to lower my security settings? Regardless of the permissions set on the filesystem, as guarded by SELINUX, with no httpd process running?

According to this solution I either have to use firefox exclusively to read html files installed on my system and forgo browsing the internet or browse the internet and only access html files in my home directory.

Do I understand this correctly?

more options

Did you check the Wiki article to see what directory you may have to add to the white list?

more options

The sandbox is designed to restrict access between "content" and the file system. I don't think it is supposed to prevent you from launching an HTML or text file from an arbitrary location on your system in Firefox.

How are you navigating? Are you using "Open File" to call up a system file chooser, or browsing through the address bar (using Firefox as a file browser)?


On Windows, I can start at a mapped drive root --

file:///C:/

-- or file share --

file://///host/share

-- and browse anywhere on the drive/share, but I can appreciate that paths are specified differently on Windows than other OSes. I don't know if the sandbox works differently.

more options

Well, a picture is worth a thousand words, so I added two pics to show what I'm trying to open. I have to be doing something wrong or have a bad configuration.

Thanks

more options