Re: Dumb question of the week.
- From: "Theo v. Werkhoven" <theo@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 16 Mar 2008 10:06:19 +0100
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"
.
- Follow-Ups:
- Re: Dumb question of the week.
- From: Unruh
- Re: Dumb question of the week.
- From: houghi
- Re: Dumb question of the week.
- References:
- Dumb question of the week.
- From: "Blattus Slafaly £ ¥ 0/00 :)"
- Re: Dumb question of the week.
- From: Paul J Gans
- Dumb question of the week.
- Prev by Date: Re: OpenSUSE 11.0 alpha 2
- Next by Date: Re: remote copy file
- Previous by thread: Re: Dumb question of the week.
- Next by thread: Re: Dumb question of the week.
- Index(es):
Relevant Pages
|