cancel
Showing results for 
Search instead for 
Did you mean: 

Re: xhost display

 
SOLVED
Go to solution
Regular Advisor

xhost display

Hi,

I have an issue with my xhost display for a particular user (findev) on Linux RH AS3 (hostname boxA). For example xclock works fine as root but not for another user account. It only works when I set the display to my local address and this resets whenever I log out again. Can anybody tell me how to make this a permanent fixture?

i.e.
[findev]$ xclock
Xlib: connection to "boxA.intmet.ie:0.0" refused by server
Xlib: No protocol specified

Error: Can't open display: boxA.intmet.ie:0.0
[findev]$ export DISPLAY=:0.0
[findev]$ xclock &
[1] 20235

The user account is used by multiple users therefore hardcoding my local ip address into the .profile is pointless.

Rgds,
Duffs

7 REPLIES 7
Exalted Contributor

Re: xhost display

Shalom,

Take a look at the env data.

You actually want the DISPLAY variable set to the host the user logged in from.

That can be done in the .profile file.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Regular Advisor

Re: xhost display

Hi SEP,

The problem is that the .profile is already configured with the name of the hostname exported as the display but it spits out the error message that I mentioned above.

R,
D.
Regular Advisor

Re: xhost display

Maybe to clarify:

when I execute 'xhost +' I get:

[findev@hostA findev]$ xhost +
Xlib: connection to "hostA.intmet.ie:0.0" refused by server
Xlib: No protocol specified

xhost: unable to open display "hostA.intmet.ie:0.0"

whereas it should return:

/home/finprod> xhost +
access control disabled, clients can connect from any host

Rgds,
D.
Honored Contributor

Re: xhost display

You can't run xhost unless you already have access to the DISPLAY. And if you think it's acceptable to use "xhost +" then you don't know enough to be running X anyway.
Respected Contributor
Solution

Re: xhost display

Duffs,

If you are trying to display something onto your local display, then as the user you logged into your GNOME Session as, you must execute the xhost + command as that user.

If you login as a non-priv'd user, and then 'su' to the root user, you will not be able to use the xhost command no matter if you are the root user or not.

You can modify, (I'll advise against it for obvious reasons) -or- try creating, a $HOME/.xinitrc file and put your xhost+ command in it, so that it opens up the display when your user account logs in.

Then you can su to the root user account and set your display back and execute your application.

If you are pushing a display across the network to another system, such as another Linux system, then a user *must* be logged in on the linux system graphics console and allow your appliation access by using the xhost + command on it.

If you are pushing a display across the network to a PC running ReflectionX or eXceed or eXcursion, then you will need to use the configuration utility to allow your system to access the PC Display Xserver.

There is plenty of information on this very subject on the web... just a little searching and you will find reams of information on just about every variation of Linux and how to grant X access to that vendors version of X.

Example:
http://www.leidinger.net/X/

http://www.phy.bnl.gov/cybersecurity/old/xhost_plus.html

http://www.linuxdig.com/howto/ldp/Remote-X-Apps.php

http://wiki.linuxquestions.org/wiki/XHOST

I wish you the best of luck in your endeavor.

Rick Retterer
- Rick Retterer



Regular Advisor

Re: xhost display

Heironimus,
First and foremost the purpose of this forum is to help and advise not criticise. Comments like ..."then you don't know enough to be running X anyway" are simply rude and arrogant - you should vent your frustrations on some other forum! And secondly the display is running so your pompous remark makes no sense.

Rick,
Thanks for the feedback. One of the links proved very helpful and helped me resolve the issue. The problem lay with the authorization record (magic cookie).

Regards,
Duffs
Regular Advisor

Re: xhost display

Issue resolved by adding the correct magic cookie to the xauth list.