Linux X11 Connection Rejected Because of Wrong Authentication Error and Solution

0 Refrence

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

http://hi.baidu.com/ppl309/item/8f0d6d55e671f2464fff2043


1

Q. I'm trying to login to my remote Ubuntu Linux server from Mac OS X desktop using following command:
ssh -X [email protected] xeyes
But I'm getting an error that read as follows:

X11 connection rejected because of wrong authentication.

How do I fix this error?

A. This error can be caused by various factors. Try following solutions:
Make sure you are not running out of disk space
Run df and make sure you have sufficient disk space:


$ df -H


If you are low on disk space remove unnecessary files from your system.
Make sure ~/.Xauthority owned by you

Run following command to find ownweship:


$ ls -l ~/.Xauthority

Run chown and chmod to fix permission problems


$ chown user:group ~/.Xauthority
$ chmod 0600 ~/.Xauthority

Replace user:group with your actual username and groupname.
Make sure X11 SSHD Forwarding Enabled
Make sure following line exists in sshd_config file:


$ grep X11Forwarding /etc/ssh/sshd_config

Sample output:

X11Forwarding yes
If X11 disabled add following line to sshd_cofing and restart ssh server:
X11Forwarding yes

Make sure X11 client forwarding enabled

Make sure your local ssh_config has following lines:
Host *
ForwardX11 yes

Finally, login to remote server and run X11 as follows from your Mac OS X or Linux desktop system:
ssh -X [email protected] xeyes


1、看/etc/hosts中是否有127.0.0.1 localhost.localdomain localhost,沒有則
配置主機名;
編輯配置文件:
/etc/hosts
127.0.0.1 localhost localhost.localdomain localhost
192.2.3.38 gxnndb gxnndb.happyu.cn gxnndb
其中 192.2.3.38 爲本機地址,gxnndb 爲主機名


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章