![]() the psycho cat on an HP Mini with Ubuntu
Just Beginning
Which Ubuntu to pick?
Ubuntu inside Windows
Install Software Next Steps Beyond the Basics Playing Around Troubleshooting * Off-site link
Cheap Plugs You may also want to consider donating directly to the Ubuntu project.
|
Running Sudo Graphically
What's the Issue?
For example, a lot of guides (including the first book ever published about Ubuntu) will ask you to type this sort of command: sudo gedit /etc/apt/sources.list
I will always recommend, however, that people use instead this sort of command: gksudo gedit /etc/apt/sources.list
And reserve sudo for command-line applications, like so: sudo nano /etc/apt/sources.list
Why is it an issue? 1. There are other times, though, when side effects can be as mild as Firefox extensions not sticking or as extreme as as not being able to log in any more because the permissions on your .ICEauthority changed. You can read a full discussion on the issue here. These errors occur because sometimes when sudo launches an application, it launches with root privileges but uses the user's configuration file.
gksudo firefox it uses root's Firefox configuration file.
sudo firefox it runs with root privileges but uses the user's configuration file (in this case, you can see the homepage and theme are different).
Change a few settings while launched as root, and you'll see if you dig into your Firefox profile that certain files are now owned by root.
Why not make exceptions? If you made exceptions, you would have to give people a list of all the graphical applications that are okay to run as sudo and a list of all the graphical applications that must be run as gksudo or kdesudo. Why make a list that needs to be compiled and updated, that most people won't refer to, and that is completely unnecessary? Just be consistent in suggesting good practice: gksudo and kdesudo for graphical applications. sudo for command-line applications.
But gksudo sometimes gives me an error... even though it appears to work... (gedit:####): GnomeUI-WARNING **: While connecting to session manager:
Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed. or this: Initializing nautilus-gdu extension
Nautilus-Share-Message: Called "net usershare info" but it failed: 'net usershare' returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares. Error No such file or directory Please ask your system administrator to enable user sharing. These are not real errors, and there's already been a bug report filed on the first message appearing. The developers have seen the bug and labeled it a low priority. There's also a bug report on the second one, which has been marked invalid. In the meantime, just ignore the message and keep encouraging people to not use sudo for graphical applications so they won't potentially mess up their ~/.ICEauthority and other user configuration files. Last updated 01/28/12 09:02
|
If you have suggestions or corrections for these tutorials, please post in this Ubuntu Forums thread or leave a comment on my blog. I will not give help to people posting in the above places. If you require technical support, start a support thread on the Ubuntu Forums. That is the appropriate place to ask for help. |