Open file or application as root from GUI
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.
Related videos on Youtube
Admin
Updated on November 25, 2022Comments
-
Admin 12 months
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)
-
Admin about 10 yearsrelated: askubuntu.com/questions/78116/…
-
Admin over 9 yearsas far as it concerns an application, locked to the launcher, you might find what you are looking for here: askubuntu.com/questions/118822/…
-
Admin over 8 yearspossible duplicate of How do I open a folder as root?
-
-
Admin about 10 yearsCan this method be scripted in some way that it consequentially be inserted into context menus?
-
Admin about 10 years@chrsmrrtt I don't know. It may be possible.
-
Admin about 10 yearsplease note that gksu is no longer installed per default in Ubuntu >= 13.04 - but it is still available in the repos.
-
jpaugh over 3 yearsI wish this were a little more specific about what goes wrong with plain sudo... I've done it dozens of times, and survived; I just don't remember how. I think you just have to re-own a specific X.org-related file.