Re: Running GNOME software as a user other than the session owner

On Fri, Jul 20, 2001 at 10:25:17AM -0500 or thereabouts, flint kiva net wrote:
> 	I'd be surprised if this question hasn't been asked many times before, but 
> I couldn't find it in any recent archives, and the development I'm asking 
> about is relatively recent.  If I'm running a GNOME session as one user 
> (say "abc"), and I want to run a GNOME program as another user on the same 
> machine (suppose the second user is "xyz"), how do I do it easily?

On the same machine, and presumably you're talking about on the same
monitor and in the same Gnome session.

If you have a reasonably powerful machine I think you could just
flip to another virtual console and run startx from that. Not sure.
That might be rather a load on the machine though. Similarly, if
you have another monitor, keyboard and mouse attached, you could
run it from there. But I assume you're talking about "one monitor
attached to computer, running Gnome as one user, and running the
occasional command as a different user whilst still at the same
screen, leaving all your Gnome stuff intact.

There's a few ways, depending on what you're running. Some of these may
not work.

*Not* very secure way:

At gnome-terminal prompt:

[abc box ~] $ xhost +localhost
[abc box ~] $ su xyz
[xyz box ~] $

Then you can run apps from that prompt as xyz. When you have finished
and logged out of being xyz, do "xhost -localhost". 

This is important, because the xhost command is used to say "who is 
allowed to run programs which connect to the x server" and that 
particular invocation is "anyone on the local machine". So anyone 
connected to your machine could splat stuff all over your screen 
whilst you have that done. On your box at home where there's one 
monitor and keyboard, this may not be -too- bad.  On a multi-user 
box in a university, it could be pretty bad :)

Much better way if ssh is set up to allow this: 

[abc box ~] $ ssh -l xyz localhost
[xyz box ~] $ 

-l is "login as.." and localhost is of course the local box.

This depends on ssh being set up to allow this to happen. This is
not a given at all. It works like that for me. I think that if it
doesn't work, you could try ssh -X -l xyz localhost, going by the
man page, but I don't really understand ssh or X so don't quote me :) 

Note that the panel and so on will still be abc's stuff. It won't
magically start running things as xyz for you. You'll have to do
everything from the terminal and the prompt where you ran su or ssh.
That means you have to know the name of the program to run. On the
other hand, I have vague memories of trying "panel" as the command
and getting yet another panel on the screen, owned by the new user,
and that had a nice menu.. :) I can't really remember though. 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]