0

Just wondering why there is no option in Ubuntu's desktop environment to open a program, for example Nautilus, as root. I know that I can accomplish this in the terminal, but wouldn't it benefit the Ubuntu's usability to allow this to be done by simply right clicking on a program?

draoi
  • 33

2 Answers2

5

Because that is not the intended usage of Nautilus manager. It is intended to manage user related files. Like your documents.

Because we do not use a "root" account and editing files with your admin account (aka. "sudo") will change the permissions and then break stuff. Famous files are .xsession-errors and .XAuthority in your home. If those change into anything else than what they currently are (rw- --- --- and owned by $USER:$USER) you can no longer log into the desktop.

Editing files you need to edit as a admin you should really do from command line. The occasional gksudo nautilus or even gksudo gedit might be useful but should not become common. It will at some point break stuff and that almost always happens when you least expect it and at the worst time.

Byte Commander
  • 110,243
Rinzwind
  • 309,379
1

No.

Running anything as root is dangerous for your entire system and therefore something that should only be done by experienced administrators. If that was available as simple right-click option everywhere, you can imagine how many applications would be run as root without necessity. That would be a security problem (malware or attacked/infected webbrowsers with root privileges sounds not like a good idea) and let many users accidentally destroy their installation (login-loops are probably the most common consequence of bad sudo usage).

Therefore the small extra effort to run an application as root protects careless users from too quickly doing something they might regret without having/taking time to think about it again.

Other than that, most tools that are needed by "simple computer owners" to administrate their machine like the System Settings or GParted automatically ask for the (gk)sudo password when needed.

But the terminal is not required to run an application (only if it really needs it!) as root. You may just use the Unity HUD to execute a single command. Open it by pressing Alt+F2, then enter gksudo APPLICATION-NAME and hit Enter/Return.

You could even add "Run as root..." to the right-click menu of a launcher if you want. But that requires modifying its .desktop file and is something I'm not going to describe here.

Byte Commander
  • 110,243