Operating System - HP-UX
1752328 Members
5360 Online
108786 Solutions
New Discussion юеВ

Re: X11 Connection rejected because of wrong authentication.

 
Narendra Thapa
Frequent Advisor

X11 Connection rejected because of wrong authentication.

Hi All,

I am getting this message when I try to export DSIPLAY with non root user.

I am able to run xclock with root user but when I try the same with non-root user I am getting this particular error.


I am using a linux machine to export Display.
I have HP-UX 11.31 Sept 09.
X11 Connection rejected because of wrong authentication.

# ssh -X user@abc.com
# xclock
X connection to localhost:10:0 broken (explict kill or server shutdown)


Note; I am able to run xclock (display) with root user.
"Study as if you were going to live forever; live as if you were going to die tomorrow."
2 REPLIES 2
mvpel
Trusted Contributor

Re: X11 Connection rejected because of wrong authentication.

Your example doesn't match up with your description of the error message. Which is it, an explicit kill or server shutdown or "wrong authentication?"

The explicit kill error usually means that your X server is not running on the local end of your SSH tunnel. Are you connecting to the system from a Windows machine? You need to start Xming or Exceed before you use an X application via your SSH tunnel.

If you log in as a user, then su to root, your root account will not have access to your display unless you copy the xauth magic cookie into the root .Xauthority file, or set root's XAUTHORITY env variable to your login user .Xauthority file (assuming it's readable by root.)

% whoami
joeuser
% echo $DISPLAY
:0.0
% su root
# export XAUTHORITY=/home/joeuser/.Xauthority
# xclock
*clock appears*

The .Xauthority file is managed by "xauth" - each display has a secret random-number "cookie" which is required in order to allow use of that display.

If root can't read the user's .Xauthority file, such as on an NFS mount, you need to add the cookie to root's own .Xauthority:

% whoami
joeuser
% echo $DISPLAY
localhost:10.0
% xauth list | tail -1
hostname/unix:10 MIT-MAGIC-COOKIE-1 dc5897c0f1931a0df12a7ee36c21f000
% su root
# export XAUTHORITY=/.Xauthority
# xauth add localhost:10.0 dc5897c0f1931a0df12a7ee36c21f000
# xclock
*clock appears*

You can also use the "xhost +" host-based authentication method, but that's considerably less secure than the magic cookies, not that that's saying much.
Johnson Punniyalingam
Honored Contributor

Re: X11 Connection rejected because of wrong authentication.

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1127289

http://www.cyberciti.biz/faq/x11-connection-rejected-because-of-wrong-authentication/

Hope above links, should help to resolve your problem.

if satisfied with the answers, assigning points :)
Problems are common to all, but attitude makes the difference