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?

0

2 Answers 2

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.

2
  • Okay, the thing is, every time I want to start bitcoin, I have to type sudo ./bitcoin-qt. With Linux Mint, I could right click, and there was an option to make the file executable and run it.
    – draoi
    Nov 16, 2015 at 23:02
  • @draoi the 1st and 2nd part of your comment have no relation with eachother. In Linux (not specific Ubuntu) you set it executable with sudo chmod 775 bitcoin-qt and that is it.
    – Rinzwind
    Nov 17, 2015 at 7:43
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.

6
  • Unfortunately I can't do that, because the program, bitcoin, is not from the ubuntu software center.
    – draoi
    Nov 16, 2015 at 23:07
  • You can't do what? You can do everything if you know how to approach it! How do you usually start your bitcoin application and how do you want to start it? I guess we'll find a way to achieve it. Just tell me what you need. :-)
    – Byte Commander
    Nov 17, 2015 at 6:44
  • I've got a pretty good solution now. I have a bash file that opens the application for me, with these two lines of code: #!/bin/bash sudo ~/Documents/bitcoin-0.11.2/bin/bitcoin-qt
    – draoi
    Nov 18, 2015 at 9:23
  • #!/bin/bash #########
    – draoi
    Nov 18, 2015 at 9:25
  • sudo ~/Documents/bitcoin-0.11.2/bin/bitcoin-qt
    – draoi
    Nov 18, 2015 at 9:26

Not the answer you're looking for? Browse other questions tagged .