0

I have to right-click in my File Browser to open as root (more specifically, any time I want to edit files), and I'd like to prevent having to do this step every time. I edit files a lot, obviously 😂

  • Coming from Windows!
  • 4
    Login as root.. – 炸鱼薯条德里克 Feb 12 at 1:49
  • 3
    Use the terminal to become root and then edit the files that way. It's a lot more efficient than using the file browser. – Nasir Riley Feb 12 at 1:53
  • 5
    I have no idea which DE you are using, but just run the file-browser as root, e.g. sudo dolphin. I don't recommend it though, for security concerns. – Sparhawk Feb 12 at 1:58
  • 1
    Naughty naughty. Learn how to use a text editor - vi/vim (painful but very powerful if you can get through learning it well enough), nano (small, simple, and always there) are in all *nix systems, I like joe because it is a clone of the wordprocessor i used back in the 80s, plenty of others. GUI is great for desktop use and managing files in a desktop environment, but for system administration the command line and text editor is "better" - for me anyway. – ivanivan Feb 12 at 2:06
  • I wonder what you have to edit that much as root; I rarely, if ever, do that and then I'm usually doing it comfortably from a root (unrestricted) shell, instead of switching ids back and forth. Anyways, running a "File Browser" or full desktop environment as root is a lousy advice -- you may be the best rootest guy in the universe, those gnome/kde/whatever beasts are usually so broken that you'll end up hosing your system even without being exploited or doing any mistake. – Uncle Billy Feb 12 at 6:19
0

You can run at the most local level something as root. For example,

  • If you need to run all command in terminal as root, simply get root in a terminal sudo su.
  • If you need to run all commands in file browser as root, simply get root in a file browser by running gksudo nautilus (or whatever file browser you're using)

Note. This isn't very wise. You don't normally want to edit ANY files as root. If you're editing them all the time, consider stepping back and asking a better question with more of your workflow -- like "how would you do this."

It's also very normal for these questions to emerge because something is running as root that shouldn't be running as root then that something creates its files as root. If this is the case, consider running whatever is creating the files as your local user. Or, as a user in the same group.

  • What benefit does sudo su have over sudo -s? – Ed Grimm Feb 12 at 2:17
  • That's a different question, and we discourage that on the site. But to not be a jerk about it sudo su does not preserve the environment while sudo -s does, and if that doesn't mean anything to you'll have to ask another question. – Evan Carroll Feb 12 at 2:31
  • 1
    Who wouldn't prefer their own environment? Or... sudo -i... – Ed Grimm Feb 12 at 2:33
  • ... new question. – Evan Carroll Feb 12 at 2:35
  • EvanCarroll, I think @EdGrimm is not so much asking a new question per se, but querying the validity of your suggestions. I also use sudo -i. Similarly, AFAIK gksudo has been deprecated, and removed from many distros. I think (but am not sure) that plain sudo should work now, possibly with -H depending on your distro's defaults. – Sparhawk Feb 12 at 2:53

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.