0

Disclaimer :

This question is meant to be answered for Educational and learning purpose.
  /root is an important directory meant to be only accessible to Root user.
Accessing /root through a browser may lead to breaking some rules of system
  causing unknown security issues with the system, So, Do it at your own risk !

Using URI Scheme file:// protocol we can access the files and folders on our local system through any browser.

file:/// in Mozilla Firefox

But,

  1. Is there a way to access /root directory from Chromium or Firefox or any other browser ?
  2. If yes, Will it be a security flaw on the part of browser ?
  • 2
    Why do you think the browser process is any different from any other process on the system? – Ignacio Vazquez-Abrams Apr 29 '18 at 8:59
  • 1
    Anything is possible, however in the name of security, do you really want do do that? – Rui F Ribeiro Apr 29 '18 at 9:17
  • 1
    Do not try to work around security protections for your own good. root should not be used to regular operations or even regular maintenance. use a non-priliged user. – Rui F Ribeiro Apr 29 '18 at 9:28
  • 2
    @C0deDaedalus Just chmod 0777 /root or run the browser as root. – dsstorefile1 Apr 29 '18 at 9:57
  • 1
    @C0deDaedalus /root is no different from any other folder. To access it in a browser you would either need the folder to be readable by an unprivileged user or have the browser run as root. Both of these are a bad idea as that's either leaking sensitive files or potentially compromising your system – Torin Apr 29 '18 at 10:24
3

As you are trying to access using file:// urls, so access is to the local machine and therefore the directories you can see will be limited to whatever the logged on user that ran the browser, can see.

/root is not a particularly special directory except that it is the home directory of root user. So root user obviously can see it. So will anybody else who is either in the group the /root directory is set to (usually root group) or indeed anybody on the machine if the /root is set world readable.

Note that contrary to the comment posted to your question, to do what you ask, it should be enough to set the directory rights to 0755 - group and world readable instead of 0777 which sets the directory to world writeable and is therefore even bigger security risk.

By and large there shouldn't be anything in /root dir of any interest, so the whole idea is a security risk with no inherent value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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