[Novalug] X clients while sudo'ing?

Mark Smith mark at winksmith.com
Wed Oct 21 00:01:49 EDT 2009


On Tue, Oct 20, 2009 at 09:20:03PM -0400, Opus wrote:
> Mark Smith wrote:
> >if i sudo to another user and then try to run an X client, it fails
> >with:
> >
> >	No protocol specified
> >	xterm Xt error: Can't open display: :0.0
> >
> >i'm thinking i can avoid this with some smart usage of xauth, but
> >it's not obvious to me what that smart usage should be.  anyone
> >have a quick answer for me?
>
> I do the command I want on the same line as the sudo command, such as
> 
> sudo root nmapfe
> 
> This works for me in both Debian and Ubuntu.

aha... i tracked it down.  definitely security related.  "xhost +"
turned off security and it worked fine.  that led me to the command:

	xhost +SI:localuser:mark.smith

then it seems to work okay. now.  thanks.

-- 
Mark Smith
mark at winksmith.com
mark at tux.org



More information about the Novalug mailing list