D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Thanks but there's more!!!!

 

Andrew Spillman wrote:
>>> Use sudo again Christopher.
>>> sudo gedit /etc/sane.d/snapscan.conf
>> You can't do that. Graphical applications cannot be run by root (well, 
>> they could be, if you start an X server as root- which is even more of a 
>> no no)- the X server belongs to your user. And rightly so. Learn a 
>> simple command line editor- if you ever really mess up your system that 
>> will be essential anyway.
> 
> sudo gedit works absolutely fine for me in Ubuntu

Traditional "sudo" doesn't do this.

SUDO traditionally (correctly I think) doesn't preserve the X
environment variables or set permissions to allow root to write to the
users X session.

e.g.

$sudo gedit /tmp/a
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

cannot open display: (null)
Run 'gedit --help' to see a full list of available command line options.



Debian has tools like gksu which do this sort of thing, for those that
feel the need. I think Ubuntu uses one of those to do it's magic.

Thus Ubuntu have done something to make it slightly friendlier (and less
secure).

> sudo only asks for your password once, unless you don't use sudo for 5
> minutes or so.

That is also configurable. Remembering passwords like that, as MacOS
does, creates yet another way to get root from an ordinary users
account. It is probably fine for personal desktop use where you are the
admin, but I wouldn't want it on enterprise desktops.

It is considered very bad practice to run graphical tools as root, as it
exposes the whole system to bugs in the GUI software, libraries etc. One
of the many reasons Microsoft Windows boxes get reinstalled more often
than GNU/Linux is more code can screw up the system because it has
permissions to break more when it goes wrong.

It pays to master at least one console mode editor, honest, I really
don't care which ex/vi/vim/emacs/nano/... - not necessarily in that order.



-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html