Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
1  
related: askubuntu.com/questions/78116/… –  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: askubuntu.com/questions/118822/… –  Jacob Vlijm Mar 29 at 12:34

1 Answer 1

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

$ 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. –  Herman Torjussen Oct 19 '13 at 19:15
2  
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

 
discard

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.