Open a password dialog if the user wants to copy files to a folder he has no permission for

Registered by Matthias Bohnen on 2007-03-02

If user A wants to copy a file from his home directory to, let's say, the /usr directory (or any other directory he has no permissions for), the file manager displays an error message:

"Error while copying to <pathname>"
You do not have permissions to write to this folder.

Now, in the terminal, using command "cp", he would get the same error (permission denied). Simple solution: add "sudo" in front of the command.

In the file manager, there is no equivalent to "sudo". It is simply impossible to copy a file to any directory he has no permissions for. Even if he knows the password, there is no possibility to enter the password.

Solution:
When displaying the error message, allow the user to enter the password to get temporary root rights.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
Proposed for hardy
Implementation:
Not started
Milestone target:
milestone icon hardy-alpha-1

Related branches

Sprints

Whiteboard

Work on this is currently ongoing in upstream Nautilus, as part of the work on gio/gvfs: http://blogs.gnome.org/alexl/2007/11/23/file-operations-in-nautilus-gio-and-adventures-in-the-land-of-policykit/ --Michael Plump

similar to https://blueprints.launchpad.net/ubuntu/+spec/sudo-when-needed

There should be a more fundamental solution to this problem. As I understand it, Ubuntu has the root account disabled by default, meaning it's meant more for 1 user home desktop systems than top-down 1 administrator -> 100 regular user systems. Getting this in Nautilus would be good, but it would also be good in, for instance, gedit, or file-roller, or whatever. In the current system, you'd have to quit out of gedit and run gksudo gedit in order to modify the files you wanted to modify.

--

I'm sure there would be other administrative tasks that cannot be done using the GUI method because they require a terminal password. A password box for these kind of tasks should be a system-wide design principle in Hardy to aid the adoption of Ubuntu by less technically knowledgeable users. -AC

---
I don't know if this helps, but maybe this can be implemented in a similar way as command-not-found-magic was implemented in gutsy, at least for the terminal...
For graphical software I think that this is not enough

(?)

Work Items