FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 05-18-2010, 06:09 PM
Robert Latest
 
Default How to run an X program as a different user?

Hello all,

my question is already in the subject line. Also I think that I've got
the basics figured out, it's just that I don't understand the details.

Essentially I want user A to run a specific X app as user B. So I
think I need to write a tiny shell script like this:

#!/bin/sh
xhost +B
sudo -u B /path/to/app arg1 arg2 arg3
xhost -B

I need help with two things though:

One, "xhost +B" doesn't work, contrary to the manpage. "xhost +"
works, granting X access to the entire Net, but who cares. This is
just a home computer.

Two, I can't figure out for the life of me what the entry in
/etc/sudoers must look like to make sudo do what I want.

Thanks,
robert


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTinaGUvyzL8f_eIwWB4dmbf2i9VJHKFrwuq-9HD7@mail.gmail.com">http://lists.debian.org/AANLkTinaGUvyzL8f_eIwWB4dmbf2i9VJHKFrwuq-9HD7@mail.gmail.com
 
Old 05-18-2010, 07:20 PM
Clive Standbridge
 
Default How to run an X program as a different user?

> Essentially I want user A to run a specific X app as user B. So I
> think I need to write a tiny shell script like this:
>
> #!/bin/sh
> xhost +B
> sudo -u B /path/to/app arg1 arg2 arg3
> xhost -B

Alternatively,

sux B /path/to/app arg1 arg2 arg3
Needs user B's password.
Requires package sux.

If you have sshd set up with X forwarding enabled, you could also do
ssh -X B@localhost /path/to/app arg1 arg2 arg3
but this one feels like overkill.

--
Cheers,
Clive
(end of message)


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100518192058.GA3841@rimmer.esmertec.com">http://lists.debian.org/20100518192058.GA3841@rimmer.esmertec.com
 
Old 05-18-2010, 08:59 PM
Liam O'Toole
 
Default How to run an X program as a different user?

On 2010-05-18, Robert Latest <boblatest@googlemail.com> wrote:
> Hello all,
>
> my question is already in the subject line. Also I think that I've got
> the basics figured out, it's just that I don't understand the details.
>
> Essentially I want user A to run a specific X app as user B. So I
> think I need to write a tiny shell script like this:
>
> #!/bin/sh
> xhost +B
> sudo -u B /path/to/app arg1 arg2 arg3
> xhost -B
>
> I need help with two things though:
>
> One, "xhost +B" doesn't work, contrary to the manpage. "xhost +"
> works, granting X access to the entire Net, but who cares. This is
> just a home computer.
>
> Two, I can't figure out for the life of me what the entry in
> /etc/sudoers must look like to make sudo do what I want.
>
> Thanks,
> robert
>
>

Consider using the gksu package instead.

--
Liam O'Toole
Birmingham, United Kingdom



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: slrnhv5vtj.b3s.liam.p.otoole@dipsy.selfip.org">htt p://lists.debian.org/slrnhv5vtj.b3s.liam.p.otoole@dipsy.selfip.org
 

Thread Tools




All times are GMT. The time now is 09:31 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org