.Xauthority 文件为空

.Xauthority 文件为空

我一直在尝试ssh -X让我的集群运行 OpenSUSE 11.2。它曾经对我很有效。但现在我收到这样的消息:

X11 connection rejected because of wrong authentication.
Failed to open the X11 display!

.Xauthority所以我尝试使用检查文件的所有权和权限

sudo ls -al .Xauthority

我发现该文件是空的,大小为 0:

-rw------- 1 <my-user-name> users 0 2014-07-31 10:03 .Xauthority

当我登录时ssh -Xv

当我尝试打开时,我收到以下信息xlock

debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384
debug1: client_request_x11: request from ::1 53267
debug1: channel 1: new [x11]
debug1: confirm x11
X11 connection rejected because of wrong authentication.
debug1: channel 1: free: x11, nchannels 2
Error: Can't open display: localhost:10.0

我该如何解决这个问题?

答案1

如果远程服务器上包含主目录的文件系统已 100% 满,或者如果磁盘配额有效并且您超出了配额,则可能会创建一个新的零长度文件,但不会向其中写入任何内容。这将阻止sshd将 X11 会话 cookie 写入文件.Xauthority,从而导致 X11 转发失败。

在尝试更详细的操作之前,使用命令df -h .和检查这些条件。quota如有必要,请清除一些空间,然后注销并重试。

答案2

尝试添加一些显示:

mcookie|sed -e 's/^/add :0 . /'|xauth -q

mcookie|sed -e 's/^/add :1 . /'|xauth -q

......................................

相关内容