Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to open a file or application as root from the GUI?

My ideal would be right-clicking on a file or an application and seeing an "Open as Root" choice in the context menu, after which I was asked for my root password.

Somewhat related to this is the ability to allow, for example, a save to take place where originally you had not opened the application as root (e.g., modifying a .conf file in /etc)

share|improve this question
related:… – Takkat Oct 19 '13 at 19:17
as far as it concerns an application, locked to the launcher, you might find what you are looking for here:… – Jacob Vlijm Mar 29 '14 at 12:34
possible duplicate of How do I open a folder as root? – Mhmd May 26 '15 at 12:35

To run GUI applications with elevated permissions, you can use the gksu command:

You can check to see if it's installed with which gksu and if so it will output the path to the command. If not you can install it with the command sudo apt-get gksu

$ gksu nautilus           # browse files as root
$ gksu gedit /etc/fstab   # edit file as root

This command is a frontend to the su and sudo commands, designed for running graphical programs, so it is used the same way as them. See the man page for more information.

share|improve this answer
Can this method be scripted in some way that it consequentially be inserted into context menus? – chrsmrrtt Oct 19 '13 at 19:13
@chrsmrrtt I don't know. It may be possible. – user54813 Oct 19 '13 at 19:15
please note that gksu is no longer installed per default in Ubuntu >= 13.04 - but it is still available in the repos. – Takkat Oct 19 '13 at 19:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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