X11 connection rejected because of wrong authentication

Nataraj picture Nataraj · Jun 30, 2014 · Viewed 27.7k times · Source

I am getting a error while accessing the firefox using X11Forwarding.

[root@station2 ~]# firefox
KiTTY X11 proxy: wrong authorisation protocol attemptedKiTTY X11 proxy: wrong authorisation protocol attemptedError: cannot open display: localhost:10.0

setup the following values: /etc/ssh/sshd_config

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

** Installed the package**

#yum install xorg-x11-xauth
#yum -y install xauth

[root@station2 .ssh]# echo $DISPLAY
localhost:10.0

#mkxauth -c
adding key for station2.example.com to /root/.Xauthority ... done

Answer

Vinitha picture Vinitha · Jun 19, 2019
export XAUTHORITY=$HOME/.Xauthority

This fix worked for me