Re: Dumb question of the week.



The carbonbased lifeform Paul J Gans inspired alt.os.linux.suse with:
"Blattus Slafaly £ ¥ 0/00 :)" <boobooililililil@xxxxxxxxxxxxxx> wrote:
How do you change to su or root in KDE when a KDE program requires Root
privs? That is without ending the entire session and logging into KDE
as root with the bomb screen and everything. I'm just thinking about
su'ing in a console terminal and executing the KDE program from the
command line? Is that the way? Just tried it, seems to work. If there is
another way, let me know. Thanks.

Pay no attention to the insults. Some folks do that.

And sometimes well deserved too.

Let me give you (and them) an example. Say I want to
run "ifconfig" to check on something with my network
connection. You cannot run that as a normal user because
it will not be found by a normal user's search path.

What I do is in a console window run (the $ is the prompt)

$ su

which asks for a password and then (in 10.3 at least) gives
me a blood-red prompt. I can then type

$ ifconfig

and it runs. I then do

Not if /sbin isn't in your PATH already, and then you can also run it as
user.
Rtfm; 'su' by itself doesn't change the enviroment variables.

$ echo $PATH
/home/theo/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/gam
es:/opt/kde3/bin:/usr/lib/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/li
b/qt3/bin:/usr/java/jre1.5.0_01/bin:/usr/sbin:/sbin:/home/theo/bin:/usr/java/jre
1.5.0_01/bin:/usr/sbin:/sbin:/home/theo/bin:/usr/java/jre1.5.0_01/bin

$ su
Password:
root:/home/theo # echo $PATH
/home/theo/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/gam
es:/opt/kde3/bin:/usr/lib/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/li
b/qt3/bin:/usr/java/jre1.5.0_01/bin:/usr/sbin:/sbin:/home/theo/bin:/usr/java/jre
1.5.0_01/bin:/usr/sbin:/sbin:/home/theo/bin:/usr/java/jre1.5.0_01/bin

Only if I use su with '-', so it gives me a login shell, do I get root's
PATH
$ su -
Password:
root:/root # echo $PATH
/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:
/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/jvm/jre/bin:/usr/lib/mit/bin:
/usr/lib/mit/sbin:/usr/lib/qt3/bin:/usr/java/jre1.5.0_01/bin


$ exit

Try ^d

to get out of being root before I do anything stupid.

If you really want to run a one-off command, or a small sequal of
commands as root, use 'su - -c "command;command;.."'

There are other programs where you can, instead, run

$ sudo xxxxx

which asks for the root password and then, if you enter it

Only if you've set 'rootpw' option in sudoers, otherwise it asks for the
user's password by default.

properly, runs program xxxxx for you. Permission to be root
expires quickly after the end of program xxxxx.
But this technique will not find any program not on your path.

Again: rtfm.
Unless you set 'set_home' in sudoers, so you get root's PATH when you
invoke sudo -s.

The reason for all this is that the havoc you can work by being
root is unmeasurable. It isn't hard to blow away whole groups
of directories or even wipe the machine totally.

That's exactly the point of having an account like root, to be able to
do those things without backtalk from the OS with questions like 'are
you sure'...
And why you then first mention 'su', instead of sudo without the rootpw
option, is beyond me.

Theo
--
theo at van-werkhoven.nl ICQ:277217131 SuSE Linux
linuxcounter.org: 99872 Jabber:muadib at jabber.xs4all.nl AMD XP3000+ 1024MB
"ik _heb_ niets tegen Microsoft, ik heb iets tegen
de uitwassen *van* Microsoft"
.



Relevant Pages

  • Re: [kde-linux] Dolphin config
    ... I could not make Plasma work in any relyable way. ... previous use of kde. ... but specific to a particular user's kde config. ... To get the root user settings, you have several options which may or may ...
    (KDE)
  • Greetings / Newbie questions
    ... I am having a bit of trouble deciding which to use: Gnome or KDE. ... - Running Totem as Root (I've found that lots of things need to be done ... I have Installed Unreal Tournament 2004 for Linux. ... these current versions to be excellent in terms of ease of installation and ...
    (alt.os.linux.redhat)
  • Re: [kde] Cannot add Brother printer
    ... It would appear that the default config for cups is to use the root login. ... KDE also provides a user the opportunity to run any program as ... GUI apps have a very big advantage in that respect and one can ... mistakes as things are easily corrected from the shell. ...
    (KDE)
  • Re: Greetings / Newbie questions
    ... Please, don't jump on the "Linux is the be-all, end-all OS and is ... I am having a bit of trouble deciding which to use: Gnome or KDE. ... >I have found that alot of things need to be done as root. ...
    (alt.os.linux.redhat)
  • Re: [kde-linux] KDE 4. Trying to get it working like I need it to.
    ... I have both KDE 3.5 and KDE 4 installed. ... I have to be root to do this. ... Akonadi Server Self-Test Report ... config that deliberately does NOT install a working backend. ...
    (KDE)