没有 xauth 程序;无法转发 X11

use*_*739 2 ssh x11 macos

我在使用时收到以下错误消息ssh -v -Y。服务器操作系统是 mojave。有人知道出了什么问题吗?

debug1: No xauth program.
Warning: No xauth data; using fake authentication data for X11 forwarding.
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Remote: No xauth program; cannot forward X11.
X11 forwarding request failed on channel 0
Run Code Online (Sandbox Code Playgroud)

Ken*_*ter 11

您的客户端和服务器都在抱怨他们找不到 xauth 程序。“debug1: No xauth program”消息来自您的客户端,说它在xauth本地找不到副本。“远程:没有 xauth 程序;无法转发 X11”消息来自服务器,说它也找不到 xauth。客户端和服务器的默认位置都是/usr/X11R6/bin/xauth,但您的供应商可以更改它。

对于客户端,您可以在.ssh/config 中设置 Xauth 位置:

XAuthLocation /some/path/to/xauth
Run Code Online (Sandbox Code Playgroud)

对于服务器,您必须在远程服务器的sshd_config 中设置位置:

XAuthLocation /opt/X11/bin/xauth
Run Code Online (Sandbox Code Playgroud)

修改配置后,您应该运行sshd -t以验证配置,然后重新启动sshd以使其重新读取文件。


dr-*_*jan 5

我必须使用 dnf 安装 xauth:

dnf install xauth
Run Code Online (Sandbox Code Playgroud)

然后一切开始按预期进行。对于较旧的 Redhat 系统,请在上面的命令中使用“yum”而不是“dnf”。