Sometimes I need to edit files in /etc
. I know I can do this with the console (sudo mv some/file /etc/some/file
, sudo nano /etc/some/file
) etc, but I find this way a bit clunky. Call me spoiled, but I'm really used to GUI tools such as Nautilus and Gedit.
Distributions such as Ubuntu Mate or Mint make it easy: I can right click a folder and then a context menu appears with options such as "open as administrator". From then double-clicking a text file opens it in gedit with elevated privileges.
However, I can't find such an option in the default Unity version of Ubuntu:
Note:
- I am aware of the question Ways to run Nautilus with elevated privileges , but the solution recommended here is to use
gksudo
, which no longer works - I suppose I can always do
sudo gedit /etc/whatever
, but - AFAIK - usingsudo
with GUI tools is heavily ill-advised - I recall some say that it is ill-advised to run GUI tools with elevated privileges at all. This doesn't seem to be the case, however, since some default GUI tools themselves ask for elevation, Ubuntu Software being perhaps one of the most prominent examples:
Is there a way to run Nautilus or Gedit with elevated privileges?
admin://
thing should also work with other GNOME utilities like gedit.gedit admin:///PathToRootFile
.GDBus.Error:org.freedesktop.PolicyKit1.Error.Failled: Unix process subject does not have uid set