Is the difference between sudo cmd
and gksu cmd
, the same as the difference
between starting a shell with sudo -i
and sudo -s
?
... or put another way,
Is sudo cmd
the same as sudo -i cmd
and gksu cmd
the same as sudo -s cmd
?
EDIT: Based on what I read on an Ubuntu Documentation Page where it says:
You should never use normal sudo to start graphical applications as root.
You should use gksudo (kdesudo on Kubuntu) to run such programs. gksudo sets
HOME=~root, and copies .Xauthority to a tmp directory. This prevents files
in your home directory becoming owned by root.
(AFAICT, this is all that's special about the environment of the started
process with gksudo vs. sudo).
The "AFAICT" doen't really give me full confidence that there is nothing more to it.
(..a belated UPDATE: I tested his commemnt today (2 months later) about:
"This prevents files in your home directory becoming owned by root."
All files I created via sudo/gksu were all owned by "root", and the group was "root".)
I've read parts of the info sudo
and noticed the -i
and -s
seem to be doing the same thing as the AFAICT environment issue...
but I hit overload.. so I've asked my question here.
PS.. My question is not about sudo vs gksu
.. It is more about: Is gksu the same as sudo -s
.. and if not, how do they differ?
graphical
frontend ... a GTK app runs quite happily regardless of whether it is started via sudo or gksu... but it does run the progam in a different environment... (I'll add some more to my question to point out why I've asked the question... – Peter.O Nov 06 '10 at 21:40graphical frontend
. I always use the terminal to run sudo/gksu... but in the spirit of brute-force trying everything I could think of, I tried runningsudo
andgksu
via Alt+F2... Bingo! ..sudo
disappeared into the void, butgksu
rose to the occasion and presented me with the (legendary)graphical forntend
... It is the same dialog as that which appears for Synaptic Package Manager etc... – Peter.O Nov 07 '10 at 00:55gksu
changes the XAUTHORITY folder, andsudo
does not... I'm not sure what that's all about, but it seem significant!... This has solved my dilema... (details in my answer below) – Peter.O Nov 07 '10 at 05:08