繁体   English   中英

使用 Cygwin ssh 的 X11 转发得到端口 6000 连接被拒绝

[英]X11 Forwarding using Cygwin ssh got port 6000 Connection refused

我尝试使用 Windows 10 机器作为客户端和 Ubuntu Linux 机器作为服务器转发 X11。 ssh 在 Cygwin 下运行,其中包含 xinit 和 xorg。 步骤:

  1. 打开linux服务器机器。
  2. 我使用 sshd_config 配置文件在客户端和服务器端启用了转发。
  3. 我通过执行在 Cygwin 中设置显示: export DISPLAY=r1:0.0 其中 r1 是服务器的名称
  4. 我在服务器端启用了访问列表:xhost 192.168.1.143
  5. 使用 ssh 从 Cygwin 连接到服务器。
  6. 运行 lxterminal 应用程序,但得到:
 r1@r1:~$ lxterminal debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384 debug1: client_request_x11: request from 127.0.0.1 37184 connect r1 port 6000: Connection refused

r1 服务器端口 6000 是否被拒绝? 如果是,怎么会?

来自 xorg-server-*1.17.4-1 cygwin 公告

https://sourceware.org/ml/cygwin-announce/2015-10/msg00111.html

'-nolisten tcp' 现在是默认设置,因此服务器只接受 unix 域套接字上的本地连接。 添加了“-listen”选项,可用于恢复以前的行为。

我想 Linux 服务器上也发生了同样的事情

我正在使用 Ubuntu 20.04。 我也无法连接到端口 6000。

最终有效的是这个黑客:

sudo vi /usr/bin/Xorg

并将-listen tcp添加到 Xorg 命令:

#exec "$basedir"/Xorg.wrap "$@"
 exec "$basedir"/Xorg.wrap "$@" -listen tcp

然后保存退出文件,重启用户图形界面:

 sudo service gdm restart

然后检查端口 6000 是否打开:

 nmap localhost

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM