views:

56

answers:

5

Here's the deal. I logged into a Linux box (CentOS, but that shouldn't matter) as user A. I had to build a program as user B, so I started up a terminal shell, logged into that shell as B, and built it. When I try to run the app, I get this message:

"connect to ":0.0" refused by server"

Most likely because the current X Windows session is owned by user A, and as B, I don't have permissions to access A's stuff.

Is there a correct way to solve this. Any incorrect ways?

A: 
ssh -X userb@localhost

(and someone with more rep than me should move this to SU)

Anon
+1  A: 

I'm not sure how you logged in, but if it was something like this:

sudo -i userB

the DISPLAY and TERM variables are left unchanged, and you may need to set them.

richj
A: 

I found ssh -Y ... worked as well.

Eric
A: 
xhost +

From user who ran X server.

TBH
A: 

xhost +localhost opens your box to allow all users on your box to run their X software on your screen. Obviously, this also allows for practical jokes from other users.

ammoQ
Hah, I was faster by 21 seconds!
TBH
TBH: congrats, missed that :-))
ammoQ