Equivalent of su for GUI?
I've just installed Debian on a cheap old computer and I'm fiddling
around with it. One thing that I find somewhat irritating is having to
switch out from X to a virtual terminal or run an Xterm, where I must
then su if I want to do admin stuff. Is there any way to achieve an
effect similar to su, but gain root privs within the X session? That
is, I would like to be able to do something so that when I, say, double-
click on some /etc file in Konqueror and it opens in Kwrite, I will have
write privs. I want to gain the ability to do superuser things from
within my existing X session, in the same GUI way I would do them as a
normal user.
I've asked some people and they said there's no such thing, but I
thought I would ask here anyway. (I'm really rather surprised; it seems
silly to have to always have an Xterm open just to edit text files when
you've got the whole GUI up.) I was able to hack a semi-solution by
writing a Konqueror servicemenu that does 'kdesu "kfmclient exec %u"',
but that only works for the specific case of double-clicking files in
Konqueror, and even that doesn't work completely. Ideally, I'd like a
solution that's as complete as su.
Thanks for the help.
--
--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is
no path, and leave a trail."
--author unknown
Re: Equivalent of su for GUI?
OKB (not okblacke) wrote:
[color=blue]
> I've just installed Debian on a cheap old computer and I'm fiddling
> around with it. One thing that I find somewhat irritating is having to
> switch out from X to a virtual terminal or run an Xterm, where I must
> then su if I want to do admin stuff. Is there any way to achieve an
> effect similar to su, but gain root privs within the X session? That
> is, I would like to be able to do something so that when I, say, double-
> click on some /etc file in Konqueror and it opens in Kwrite, I will have
> write privs. I want to gain the ability to do superuser things from
> within my existing X session, in the same GUI way I would do them as a
> normal user.
>
> I've asked some people and they said there's no such thing, but I
> thought I would ask here anyway. (I'm really rather surprised; it seems
> silly to have to always have an Xterm open just to edit text files when
> you've got the whole GUI up.) I was able to hack a semi-solution by
> writing a Konqueror servicemenu that does 'kdesu "kfmclient exec %u"',
> but that only works for the specific case of double-clicking files in
> Konqueror, and even that doesn't work completely. Ideally, I'd like a
> solution that's as complete as su.
>
> Thanks for the help.
>[/color]
However you could look at 'sux' which permits you start off X applications
from the command line for root.
Re: Equivalent of su for GUI?
Madhusudan Singh wrote:
[color=blue]
> However you could look at 'sux' which permits you start off X
> applications from the command line for root.[/color]
I've seen that, yes, thanks. I realize I can run programs from the
command line by using sux or xhost + or whatever. What I'm interested
in, though, is doing things as root from the GUI.
--
--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is
no path, and leave a trail."
--author unknown
Re: Equivalent of su for GUI?
This morning, [email]BrenBarn@aol.com[/email] wrote:[color=blue]
> I've seen that, yes, thanks. I realize I can run programs from the
> command line by using sux or xhost + or whatever. What I'm interested
> in, though, is doing things as root from the GUI.[/color]
It depends on what you use, I think. For example, KDE allows you to
specify the user an specific application should run as (in your case:
root)[1]. GNOME and Redhat extensively use something called consolehelper
to do the same. The problem with consolehelper is that it requires a
little bit more configuration in the system than kdesu, but the result
is pretty much the same.
Roberto.
Footnotes:
[1] It uses a utility called kdesu to do so. You can try running
something as "kdesu foobar", where foobar is your application to see
how it works (and to verify that I understood what you want)
--
\---- roberto selbach teixeira --- [email]rst@iname.com[/email]
\------------------- [url]http://techtux.com/rst.php[/url]
\---------------------------- Curitiba, Brasil
Re: Equivalent of su for GUI?
Roberto Selbach Teixeira wrote:
[color=blue]
> It depends on what you use, I think. For example, KDE allows you to
> specify the user an specific application should run as (in your
> case: root)[1]. GNOME and Redhat extensively use something called
> consolehelper to do the same. The problem with consolehelper is
> that it requires a little bit more configuration in the system than
> kdesu, but the result is pretty much the same.
>
> Roberto.
>
>
> Footnotes:
> [1] It uses a utility called kdesu to do so. You can try running
> something as "kdesu foobar", where foobar is your application to
> see how it works (and to verify that I understood what you want)[/color]
Yeah, I looked at kdesu, and it seems like that's the way to
proceed. The problem is, I want a really general way to hook it into
the GUI. I don't want to have to open a konsole and do "kdesu foo", I
want to be able to click on the "foo" icon like I normally would, only
click some other button first, or hold down Ctrl-Shift or something, and
have my GUI actions take effect with root privs.
I was able to get something like this with a servicemenu in
Konqueror, but it's limited. What it lets me do is right click a file,
then do "Open as root". Behind the scenes it runs "kdesu kfmclient exec
%u", so it opens the file with the regular association, only as root.
There are two problems, though. First, it pops up an error message
saying 'Konqueror couldn't find program "kdesu kfmclient exec %u"' (with
a literal %u in there); but it does open the file correctly anyway.
More importantly, though, this doesn't allow me to, say, right-click a
file and do "Open With" one of the other associated programs, but do it
as root. I would like to be able to do anything I can do in the GUI as
a normal user, but do it in the GUI as root.
Is there any very general hook in KDE (or any of the other desktops
-- I'd switch if it would get me this) where you can step in before it
runs any command? I'd effectively like to be able to say to KDE,
"before you run any program, check this file/key
combination/button/whatever, and if it's in the right state, then
prepend kdesu to the command you were about to run".
--
--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is
no path, and leave a trail."
--author unknown
Re: Equivalent of su for GUI?
This afternoon, [email]BrenBarn@aol.com[/email] wrote:[color=blue]
> Yeah, I looked at kdesu, and it seems like that's the way to
> proceed. The problem is, I want a really general way to hook it into
> the GUI. I don't want to have to open a konsole and do "kdesu foo", I
> want to be able to click on the "foo" icon like I normally would, only
> click some other button first, or hold down Ctrl-Shift or something, and
> have my GUI actions take effect with root privs.[/color]
I see what you want and the short answer is no. There isn't a standard
way for applications to "become root" on the fly. At least not in KDE
or GNOME.
The closest thing you could do would be something like you say you did
with the konqi service menu. Also, remember that you can go to
Properties of any application link and set it to always run as
root. Still not exactly what you want, but...
This might be actually interesting to implement. You might want to
post it as as wishlist on [url]http://bugs.kde.org[/url]...
Roberto.
--
\---- roberto selbach teixeira --- [email]rst@iname.com[/email]
\------------------- [url]http://techtux.com/rst.php[/url]
\---------------------------- Curitiba, Brasil
Re: Equivalent of su for GUI?
:: However you could look at 'sux' which permits you start off X
:: applications from the command line for root.
: "OKB (not okblacke)" <BrenBarn@aol.com>
: I've seen that, yes, thanks. I realize I can run programs from the
: command line by using sux or xhost + or whatever. What I'm interested
: in, though, is doing things as root from the GUI.
I'm not sure exactly what you want, but you can start a whole GUI session
as root. Just use X -query, or possibly xstart, with appropriate additional
options, log into the new X server as root, and you can switch back and
forth between a root GUI session and your original GUI session.
If that's not sufficient, you could use Xnest or Xvnc to have a root
GUI session show up as a windows in your own GUI session, so they are
on-screen simultaneously, and you don't have to do control alt whatnot
to switch between them. And you can use x2x or other similar tools so you
can cut and paste text between them.
As for myself, I normally start an su in an xterm, and start any
GUI components I want from there. That's not the same thing as
a root GUI session, but if you know what tools to start from /sbin,
it's lightweight and convenient. But then... that sounds like what
you didn't want to do from above, so it probably isn't what you
wanted (though I'm not sure what's wrong with it; works for me).
Wayne Throop [email]throopw@sheol.org[/email] [url]http://sheol.org/throopw[/url]
Re: Equivalent of su for GUI?
OKB (not okblacke) writes:[color=blue]
> Yeah, I looked at kdesu, and it seems like that's the way to
> proceed. The problem is, I want a really general way to hook it into
> the GUI. I don't want to have to open a konsole and do "kdesu foo", I
> want to be able to click on the "foo" icon like I normally would, only
> click some other button first, or hold down Ctrl-Shift or something, and
> have my GUI actions take effect with root privs.[/color]
You could hit ALT+F2, then type "kdesu foo" in the run dialog.
Also, you can create icons that call "kdesu foo". You can put these icons
in the menu, on the Desktop or (my preference) on the KPanel.
Terminal/Konsole window not necessary in these cases.
Your question about allowing arbitrary user ownage on the "Open With" menu
is interesting. If I were a more experienced programmer, I'd play around
with it, but I never made the transition from general Qt coder to deep KDE
hacker. :/
You should see if you can get onto a KDE newsgroup or support site and make
these suggestions.
The only thing is that other users (like root) wouldn't have the same "Open
With" options.
--
-JC
[url]http://www.jc-news.com/coding/freedom/[/url]
Re: Equivalent of su for GUI?
On Wed, 07 Jul 2004 02:49:16 +0000, OKB (not okblacke) wrote:
[color=blue]
> I've just installed Debian on a cheap old computer and I'm fiddling
> around with it. One thing that I find somewhat irritating is having to
> switch out from X to a virtual terminal or run an Xterm, where I must
> then su if I want to do admin stuff. Is there any way to achieve an
> effect similar to su, but gain root privs within the X session? That
> is, I would like to be able to do something so that when I, say, double-
> click on some /etc file in Konqueror and it opens in Kwrite, I will have
> write privs. I want to gain the ability to do superuser things from
> within my existing X session, in the same GUI way I would do them as a
> normal user.
>
> I've asked some people and they said there's no such thing, but I
> thought I would ask here anyway. (I'm really rather surprised; it seems
> silly to have to always have an Xterm open just to edit text files when
> you've got the whole GUI up.) I was able to hack a semi-solution by
> writing a Konqueror servicemenu that does 'kdesu "kfmclient exec %u"',
> but that only works for the specific case of double-clicking files in
> Konqueror, and even that doesn't work completely. Ideally, I'd like a
> solution that's as complete as su.
>
> Thanks for the help.[/color]
How about 'sudo xterm'.
Re: Equivalent of su for GUI?
Ok, thanks for the suggestions, everyone. I guess there isn't a
way to do it (rats). I have gone ahead and submitted to the KDE
wishlist, though; we'll see what comes of that.
--
--OKB (not okblacke)
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is
no path, and leave a trail."
--author unknown
Re: Equivalent of su for GUI?
: "OKB (not okblacke)" <BrenBarn@aol.com>
: Ok, thanks for the suggestions, everyone. I guess there isn't a way
: to do it (rats). I have gone ahead and submitted to the KDE wishlist,
: though; we'll see what comes of that.
I don't understand just what "it" you want to do.
Especially, why doesn't Xnest or Xvnc solve the problem.
Wayne Throop [email]throopw@sheol.org[/email] [url]http://sheol.org/throopw[/url]
Re: Equivalent of su for GUI?
On Fri, 09 Jul 2004 03:14:29 GMT,
Wayne Throop <throopw@sheol.org>, in
<1089342869@sheol.org> wrote:[color=blue]
>+ : "OKB (not okblacke)" <BrenBarn@aol.com>
>+ : Ok, thanks for the suggestions, everyone. I guess there isn't a way
>+ : to do it (rats). I have gone ahead and submitted to the KDE wishlist,
>+ : though; we'll see what comes of that.
>+
>+ I don't understand just what "it" you want to do.[/color]
If I've been paying attention and understand what the itch is, he
wants to be able to run the occasional program as root. There are ways
in Win{2k|XP} that you can obtain a "run as" option, which then pops
up a dialog asking for the other user's password. It doesn't have to
be administrator, either.
[color=blue]
>+ Especially, why doesn't Xnest or Xvnc solve the problem.[/color]
Sometimes that is severe overkill.
James
--
Consulting Minister for Consultants, DNRC
I can please only one person per day. Today is not your day. Tomorrow
isn't looking good, either.
I am BOFH. Resistance is futile. Your network will be assimilated.
Re: Equivalent of su for GUI?
:: + I don't understand just what "it" you want to do.
: [email]usenet@nttvr2x3.pbgfr.arg[/email] (I R A Darth Aggie)
: If I've been paying attention and understand what the itch is, he
: wants to be able to run the occasional program as root. There are
: ways in Win{2k|XP} that you can obtain a "run as" option, which then
: pops up a dialog asking for the other user's password. It doesn't
: have to be administrator, either.
:: + Especially, why doesn't Xnest or Xvnc solve the problem.
: Sometimes that is severe overkill.
Ah, I see what you mean. Yet... then I'm still left wondering why
"xterm su" or "sux" or some "sudo" variant doesn't suit. If the issue
I have is, you want to launch a few programs now and then as root,
you add a dialogue box with a few listed common defaults as part of
your normal launcher (ie, into one of your KDE menues, or whatever).
If the you want a whole session as su, then adding an option to
"Xnest -query localhost :1" will create one.
Since those are both easy, I must still be missing something.
I imagine some intermediate possibility is what's meant,
but I don't see what it might be, exactly.
Maybe, start a launcher as su inside your already-running session?
That'd be lighter weight than Xnest, but more GUI-like than sux.
But... that also is fairly easy, the only issue being just
what launcher to launch.
Wayne Throop [email]throopw@sheol.org[/email] [url]http://sheol.org/throopw[/url]