Make a “browse as root” launcher in Ubuntu
August 22nd, 2008
Like Mac OS X, Ubuntu includes by default a privilege escalation system that invokes sudo, which allows certain users (in the admin group) to operate as limited-privileged users for almost all tasks and to temporarily escalate (after a password authentication) to administrative privileges for specific tasks. For more details about sudo, check out the Ubuntu Wiki page on the subject.
Sometimes users want to modify system files and thus need “root” (or full administrative) privileges to make changes to those files. This tutorial will show you how to create an application launcher to “browse as root.”
Right-click on an empty spot on the panel and select Add to Panel
Select Custom Application Launcher and then click Add
The type should be Application and the command should be
The rest of the fields and the icon can be whatever you want them to be.
When you’re done filling in the fields and (optionally) selecting an icon for the launcher, click OK
Now when you click the launcher icon, you’ll be prompted for a password…
and you can browse as root and make changes to system files, all within your otherwise-unprivileged user session.
May 19th, 2009 at 8:44 am
A slightly more intuitive way of doing this is installing the “nautilus-gksu” package from Synaptic. When you next log in, if you right-click a file or a folder you will see the option to “Open as Administrator”.
For folders, this will prompt you for a password with gksudo, and then open a new instance of Nautilus as root, with your folder open. For files, it will prompt for password with gksudo and then run the appropriate program to handle the file; it will run the program as root, and open the file.
June 8th, 2009 at 3:18 am
That i so cool. I have been trying forever to get rid of a folder inmy HOME directroy that was created by accident. Great little fix. I missed the old root terminal from 8.04 but this is better.
June 8th, 2009 at 12:40 pm
This *is* cool. Only after I installed ‘nautilus-gksu’, logged out & logged back in again, it works… without giving me a password challenge.
Just to be sure, I then opened a system file from the root-nautilus window with ‘gedit’, modified it, and tried to save it. It saved my changes — so I do get root privileges. I wonder if this is a 9.04 bug..??
July 21st, 2009 at 1:58 am
You just authenticated yourself before launching synaptic. Sudo autentication is cached for a short while, so if you already gave your password in the last “n” minutes (I cant remember right exactly how many) you are not asked again
July 22nd, 2009 at 4:03 pm
Alar, I think you’re correct… I’ve since installed it on other machines and after the (I believe) 5-minute interval, it does require me to re-authenticate.
August 4th, 2009 at 3:39 am
I prefer
[ctrl]+[alt]+N
August 6th, 2009 at 8:12 pm
Thank you. I’ve needed this for a long time.
August 7th, 2009 at 4:17 pm
What *I* would like to see added to Ubuntu is a Linux version of the Windows Power Tools add-in that lets you pop-up on a folder in the file browser and pick “Command Prompt Here” — which, in Linux, would be something like “Open Terminal Here”…
Doing so would open a Terminal window and auto-execute the necessary ‘cd’ string to make your pwd become the folder you had right-clicked on. Very useful, especially if you’ve drilled down a ways in the file system to find something that you then want to do something with.
August 9th, 2009 at 8:19 am
@Ted:
This is very easily achieved in thunar (Xfce file manager) using the custom actions. One of the reasons I prefer Xfce. The same can be done using nautilus scripts in Gnome – try googling for examples.
August 13th, 2009 at 11:27 am
For Ted (and others): “Open Terminal Here”-functionality can be achieved in Ubuntu easily with ‘sudo apt-get install nautilus-open-terminal’
September 29th, 2009 at 10:41 pm
Thanks for this nifty idea! I was able to delete an unwanted file that I had accidentally created while learning how to work with files in Ubuntu 9.04.
September 30th, 2009 at 12:41 pm
@Bjorn: I just found your reply — thanks!! This works just the way I wanted it to.
Note to ‘others’: After installing it, you’ll need to log out and log back in for the right-click menu item to appear.
October 31st, 2009 at 2:40 pm
open the files in a another program…easy.
June 28th, 2010 at 8:58 pm
Just came across this and this is useful. You can add a path after gksudo nautilus in the command section.
“gksudo nautilus /home/username/”