2

Following the standard recommendation I use my Linux system with a normal account and switch to root only in special cases.

When browsing the file system using GUI sometimes an error pops up - You do not have privelige to view the contents of this folder.

At this point what I have to do is open up the terminal, switch to root using su, navigate to that directory and then list the contents using ls.

This is really tiresome and annoying. Wouldn't it be convenient if you could just right click on a directory or program in the GUI itself and have an option like Open as Root or Run as Root?

Is this possible in Linux?

I'm using GNOME 3.4.

Edit: Please no answers like directories are unaccessible for a reason. I'm not talking about free access to any directory/program but about authenticating using GUI.

  • Are you using GNOME 2 or 3? – Renan Sep 1 '12 at 5:07
  • 1
    Well, 1. if the directories aren't readable for you there's usually a good reason for it and 2. my Nautilus version 3.4.2 has exactly such an option as you describe. What system are you on precicely? I suppose you could always start nautilus as user root and use that to browse your fs. However, this may also not be what you want. – Bananguin Sep 1 '12 at 5:20
  • @user1129682 Launching nautilus as root is a good way. I tried 'su', 'nautilus' and it works. You should make that an answer. – Kshitiz Sharma Sep 1 '12 at 5:46
5

Press AltF2 to run a command and then enter gksu nautilus (using gksu is the recommended way to open GUI's with root permissions). There's a nautilus script that allows you to open a directory as root, look for nautilus-gksu on your repositories.

  • Just typing sudo nautilus in a terminal emulator would also work. – pro neon May 27 '18 at 13:40
  • @proneon running such programs with sudo alone is asking for trouble. There's plenty of pages on the internet about why, and that's why programs like gksu exist. – carandraug May 27 '18 at 20:28
  • How do we do this in ubuntu 18.04, there is no gksu package – dan carter Oct 10 '18 at 20:17
2

News from 2018: https://itsfoss.com/gksu-replacement-ubuntu/

Brief: gksu is deprecated. It is removed from Debian, Ubuntu 18.04 and other newer Linux distribution version. You can achieve the gksu functionality with gvfs admin backend. Here’s how to do that.

0

gksu is gone in Ubuntu 18.04, but has a replacement.

Previously:

gksu gedit /etc/default/apport

Now, don't use gksud but add the admin:// to the filepath:

gedit admin:///etc/default/apport

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.