$ ssh -Xvv remote_host输出
....
debug1: channel 0: new [client-session]
debug2: channel 0: send open
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: exec
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Remote: /home/user/.ssh/authorized_keys:8: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Remote: /home/user/.ssh/authorized_keys:8: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: x11_get_proto: /usr/bin/xauth list unix:16.0 2>/dev/null
debug1: Requesting X11 forwarding with authentication spoofing.
debug2: channel 0: request x11-req confirm 1
debug2: fd 3 setting TCP_NODELAY
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug2: channel 0: request shell confirm 1
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel_input_status_confirm: type 100 id 0
X11 forwarding request failed on channel 0
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0也试过-Y。不起作用。
我确认服务器端允许X11转发。$grep X11 /etc/ssh/sshd_config给
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes我已经搜索了其他与X11 forwarding request failed on channel 0相关的帖子,没有发现任何帮助信息。
发布于 2021-06-24 01:59:29
我在Devuan (没有系统的Debian叉子)上也有类似的问题。
我找到了关于Arch Wiki的一种解法。
编辑/etc/ssh/sshd_config (在服务器端)并设置:
AddressFamily inet默认情况下是AddressFamily any,但这似乎没有提供inet (ipv4)套接字。
在我的系统中,我在/var/log/auth.log中注意到:
sshd[9184]: error: Failed to allocate internet-domain X11 display socket.在对sshd_config和service ssh restart的上述更改之后,X11转发为我工作。
发布于 2023-03-07 23:32:11
通常,当我看到问题标题的错误消息时,这意味着服务器没有安装包含xauth命令的包,或者sshd守护进程由于其他原因不能使用xauth命令。
https://unix.stackexchange.com/questions/621285
复制相似问题