Ubuntu: automatic admin elevation?

Solution 1:

I believe you're searching for nautilus-gksu:

privilege granting extension for nautilus using gksu

The gksu extension for nautilus allows you to open files with administration privileges using the context menu when browsing your files with nautilus.

To install it, enter this command (or use your favorite package manager) and restart gnome (restarting only nautilus might be enough):

sudo apt-get install nautilus-gksu

This adds the context menu item open as administrator when you perform a right click on files or folders in nautilus. It is then allowed to create a folder inside a folder opened as administrator (after having entered your password obviously), as a bonus, you are able to edit as administrator any file you want.

However, I would advise against using such tools. I prefer to administer the file system from the command line, I do much less mistakes that way, being much more attentive (having things written before executing them allows me to check that I don't do anything stupid). But that's a personal choice.

With a GUI, simple tasks are even more simple, but complex tasks are impossible.


You may also create some nautilus script using gksudo for your specific administration tasks. For example, to create a folder as root you could add this script to nautilus scripts:

#!/bin/sh
cd $NAUTILUS_SCRIPT_CURRENT_URI
foldername=$(zenity --entry --title="Create new folder" --text="New folder name:") && gksudo mkdir $foldername

Lets call it mkdir_as_root.sh Make it executable and copy it where nautilus may fint it: chmod +x mkdir_as_root.sh cp mkdir_as_root.sh ~/.gnome2/nautilus-scripts

Solution 2:

You can run File Browser with gksudo. Press Alt + F2 and type gksudo nautilus. Be careful what you do though, you are running the application as root. You may also want to give this a read - File Permissions in Ubuntu - Editing files that belong to root.


But in short, no.

There is no current implementation in Ubuntu which will prompt you for credentials before performing every administration task, you will simply be denied access, that's your key indicator to elevate your privileges using sudo or a similar tool. It has been suggested, but not implemented yet.