1748002 Members
4304 Online
108757 Solutions
New Discussion юеВ

Xhost + is not working

 
SOLVED
Go to solution
Sachin Patel
Honored Contributor

Xhost + is not working

I have always problem with this X. May be because I am not understanding it correctly.

I logon in to system as a normal user then I su - then set the display

#setenv DISPLAY scrappy:0.0
#echo $DISPLAY shows me
scrappy:0.0 that is my correct display.
nslookup works both way.

When I run xhost + it generates error
Xlib: connection to "scrappy:0.0" refused byserver
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
Xhost: unable to open display "scrappy:0.0"

In other thread Mr Alex Glennie suggest to change /etc/dt/config/Xconfig file where now I have
Dtlogin*autorise: False

Sachin

Is photography a hobby or another way to spend $
8 REPLIES 8
Sridhar Bhaskarla
Honored Contributor

Re: Xhost + is not working

Try removing .Xauthority file and
login again.

-Srid
You may be disappointed if you fail, but you are doomed if you don't try
Sachin Patel
Honored Contributor

Re: Xhost + is not working

Hi Sridhar,
NOP. still same error

Sachin
Is photography a hobby or another way to spend $
Sridhar Bhaskarla
Honored Contributor

Re: Xhost + is not working

OK.

On the terminal where xhost is failing,
run the command xauth and list and see
what's happening there?.

#xauth
xauth> list



-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Alex Glennie
Honored Contributor
Solution

Re: Xhost + is not working

If you have changed Xconfig have you stopped and restarted the Xserver/dtlogin processes ?

If not the change will not take effect : try a reboot or drop to init / run-level 2 and then go back to 3 ?
Herve BRANGIER
Respected Contributor

Re: Xhost + is not working

Hi

.Xauthority file contains "magic cookie", a key
to identify a client. This file is owned by the
first user connected (so if you logon as user1
and su - root, the display is "owned" by user1).
xhost + must be launched by the display owner
(user1 in my example). So you have to use xhost +
before to su another user :

as user1 :

> xhost +
> su -

as root :

> setenv DISPLAY your_display:0.0


You can try to launch xclock for example, it may
work now...

HTH

Herv?


Sachin Patel
Honored Contributor

Re: Xhost + is not working

Hi Alex,
I reboot the system and it works. I try same thing on another workstation and it work there too. But now question is why it works on system which doesn't even have /etc/dt/config/Xconfig file

Sachin
Is photography a hobby or another way to spend $
Wodisch
Honored Contributor

Re: Xhost + is not working

Hello Sachin,

the directories below "/etc/dt/config"
are only used, well, if they exist...
if not, then the files are searched below
"/usr/dt/config" (where you should never
ever do any modifications - the next patch
will happily overwrite your work :-( copy
the file to "/etc/dt/config" and modify the
copy there).

HTH,
Wodisch
Ralf Hildebrandt
Valued Contributor

Re: Xhost + is not working

Simply use:
% ssh -X root@localhost
no DISPLAY magic needed...
Postfix/BIND/Security/IDS/Scanner, you name it...