On Sun, 26 Oct 2003 04:06:21 -0800 (PST)
Thomas Adam
--- Paul Trevethan
wrote: Hi Folks,
Just some education if I may please?
Ok, I'll try.
I was wondering if anyone can put into layman's terms for me the essential difference between using kdesu + password OR using sudo + password to run certain programs as the super user (root)?
Kdesu is normally used to provide one with a graphical means of authenticating a program to be run as root under the current $DISPLAY. The important thing here is that if you "su" to root, in order to run a graphical program you'd have to:
export DISPLAY=":0.0"
(there is more to it than that, but I don't want to digress).
kdesu however does that bit for you. Although I prefer using "gksu/gksudo".
"sudo" however is MUCH more powerful than kdesu and can be configured to do loads of things. I use it to administer certain tasks under Debian by allowing a certain group to run with root perms via sudo.
When I want to do backups of the system essentials to cd I run the burn program (usually cdbakeoven as k3b is flaky here for some reason) with kdesu but with file permissions retained. As I understand it, if I just use my user name things like files in /etc or /var or /root et al that I don't normally have access to get skipped? Is that right?
Kind of. The reason why you're running cdbakeoven as root (via kdesu) is because root will need permissios to access the cdrw device. It usually isn't used to copy information across since the normal user has read access to a lot of directories under "/" anyhow.
Of course, the other option is to set the cdbackoven program as SETUID, but I wouldn't recommend this under normal circumstances.
Anyway, I was looking at sudo and what it does and I am now unsure which method of converting to superuser is appropriate in different circumstances. I would appreciate experienced user guidance - it's just I like to do things the 'right' way, not just some way that maybe works!
There is no right or wrong way. I use "sudo" purely because it means that I can type in (as an example):
sudo aptitude install
without having to first "su". I will be submitting an article to the Linux Gazette on this at some point in the near future...
HTH,
Thomas Adam
Thank you Thomas - sounds like I can continue doing things the way I do while I do a bit more reading up on the power and usage of sudo. Google here I come (again) !! :-) Cheers, Paul.