Linux 无法重新连接到 NX 会话并出现错误:“锁定授权文件中的错误”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6964043/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 05:31:12  来源:igfitidea点击:

Failing to reconnect to an NX session with the error: "error in locking authority file"

linuxsshremote-desktopvncnomachine-nx

提问by pmohandas

I am able to start an NX session without any issues. But, when I 'disconnect' (leaving a persistent connection, as opposed to 'terminate'), I am unable to reconnect. Here is the error from /var/log/messages:

我可以毫无问题地启动 NX 会话。但是,当我“断开连接”(离开持久连接,而不是“终止”)时,我无法重新连接。这是来自 /var/log/messages 的错误:

    Aug  5 19:05:41 praveen NXNODE-3.5.0-3[20703]: ERROR: NX> 596 ERROR: NXNODE Ver. 3.5.0-3  (Error id e77ECD3) [e77ECD3] Logger::log nxnode 2963
    Aug  5 19:05:41 praveen NXNODE-3.5.0-3[20703]: ERROR: NX> 596 ERROR: create session: run commands [e77ECD3] Logger::log nxnode 2963
    Aug  5 19:05:41 praveen NXNODE-3.5.0-3[20703]: ERROR: NX> 596 ERROR: execution of last command failed [e77ECD3] Logger::log nxnode 2963
    Aug  5 19:05:41 praveen NXNODE-3.5.0-3[20703]: ERROR: NX> 596 last command: /usr/bin/xauth -v source /home/pmohandas/.nx/C-praveen-1003-707A5CF0D1B5184E1EBEDC07BB4981EF/scripts/authority [e77ECD3] Logger::log nxnode 2963
    Aug  5 19:05:41 praveen NXNODE-3.5.0-3[20703]: ERROR: NX> 596 exit value: 1 [e77ECD3] Logger::log nxnode 2963
    Aug  5 19:05:41 praveen NXNODE-3.5.0-3[20703]: ERROR: NX> 596 stdout:  [e77ECD3] Logger::log nxnode 2963
    Aug  5 19:05:41 praveen NXNODE-3.5.0-3[20703]: ERROR: NX> 596 stderr: /usr/bin/xauth:  error in locking authority file /home/pmohandas/.Xauthority [e77ECD3] Logger::log nxnode 2963

I am on a RHEL6.1 x86_64 machine.

我在 RHEL6.1 x86_64 机器上。

I tried running xauth -b quitprior to reconnecting to the NX session. No luck with that either.

我尝试xauth -b quit在重新连接到 NX 会话之前运行。也没有运气。

Does anyone know how I could get rid of this error? I find NX to be much snappier than VNC and would love to get this to work :) Thanks in advance!

有谁知道我如何摆脱这个错误?我发现 NX 比 VNC 快得多,并且很乐意让它工作:) 在此先感谢!

采纳答案by pmohandas

The problem seems to happen when you have duplicate entries in your /etc/hosts. Here is the xauth bug: http://www.kerneltrap.com/mailarchive/openbsd-bugs/2009/3/8/5118304

当您的 /etc/hosts.conf 中有重复的条目时,问题似乎会发生。这是 xauth 错误:http://www.kerneltrap.com/mailarchive/openbsd-bugs/2009/3/8/5118304

Fixed the problem by removing the duplicate entries in /etc/hosts.

通过删除 /etc/hosts 中的重复条目解决了该问题。

回答by Craig

I don't know the cause of this annoying error yet either, but a workaround is to ssh to the nx server machine and remove your ~/.Xauthority-cand ~/.Xauthority-lfiles. You'll lose any existing sessions, but you will still be able to connect.

我也不知道这个烦人的错误的原因,但解决方法是通过 ssh 连接到 nx 服务器机器并删除您的~/.Xauthority-c~/.Xauthority-l文件。您将丢失任何现有会话,但您仍然可以连接。

回答by GGB

Solution here from : http://forums.fedoraforum.org/showthread.php?t=223609

解决方案来自:http: //forums.fedoraforum.org/showthread.php?t=223609

First I must say that I'm running my installation in a virtual machine but I think that doesn't matter.

首先,我必须说我在虚拟机中运行我的安装,但我认为这无关紧要。

Problem: I found out that the hostname I enter at the installation wasn't added to the /etc/hosts file. There were only the default entries for localhost/localdomain. So the DNS server (see /etc/resolve.conf which is generated by the network manager) couldn't resolve my hostname which is needed for xauth. You can check this by traceroute your hostname (note nslookup or host won't work because they ignore /etc/hosts).

问题:我发现我在安装时输入的主机名没有添加到 /etc/hosts 文件中。只有 localhost/localdomain 的默认条目。因此 DNS 服务器(请参阅由网络管理器生成的 /etc/resolve.conf)无法解析 xauth 所需的主机名。您可以通过 traceroute 您的主机名来检查这一点(注意 nslookup 或 host 将不起作用,因为它们忽略 /etc/hosts)。

Solution: I just added my hostname to the /etc/hosts file, checked it with traceroute and connected via nxclient from my windows host.

解决方案:我刚刚将我的主机名添加到 /etc/hosts 文件中,使用 traceroute 检查并通过 nxclient 从我的 Windows 主机连接。

So adding server.craneworks to /etc/hosts should solve the problem for you.

因此,将 server.craneworks 添加到 /etc/hosts 应该可以为您解决问题。