Can anyone help me fix X11 Xauth authentication? I get the error message "X11 connection rejected because of wrong authentication".

It occurs when I switch from root user to any other non-root account.

# ssh -X {hostname}
{hostname}# xclock (works)
{hostname}# su - user
{hostname}$ xclock
X11 connection rejected because of wrong authentication.

This is normally the case when switching from a root X connection to a non-root user. There are Xauth methods to allow the authentication to pass from root to a non-root user, but they are all failing:

I have included in /etc/pam.d/su
session optional /lib/security/$ISA/
Added "X11Forwarding yes" to /etc/ssh/sshd_config

I Created ~{user}/.ssh/config file.
Host *
ForwardX11 no

Tried Xauth add

Thanks for any help.

Recommended Answers

All 2 Replies

Try to change "ForwardX11 no" to YES, in your ssh server.

Ya, I had already done that in /etc/ssh/sshd_config:

#X11Forwarding no
X11Forwarding yes

Any other ideas?


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.