我坐在一台私有 IP 机器上(本地),想安装网豆在另一台远程公网IP的机器上(remote)。本地机器运行Ubuntu,远程机器运行CentOS。
我已经下载了Netbeans 安装程序在远程机器上并将其更改为可执行文件。
现在,当我远程发出命令时,
# ./netbeans-8.1-linux.sh
我收到一条错误消息,
没有设置 X11 DISPLAY 变量,但该程序执行了需要该变量的操作。
为了解决这个问题,我远程运行,
# export DISPLAY=:0
在当地,我跑,
$ xhost +
并在远程重新运行安装程序并打开详细标志,
./netbeans-8.1-linux.sh --verbose
这给出了错误信息,
无法使用‘:0’作为 DISPLAY 变量的值连接到 X11 窗口服务器。
(我尝试了其他类似的变体0.0
)。
正如网上搜索显示的那样,我唯一的选择就是远程发出命令,
# export DISPLAY=my.private.ip.address:0
这应该会失败,而且实际上也会失败,因为这涉及从真实 IP 机器访问私有 IP 机器。
这是我面临的障碍,需要您的帮助。
编辑
使用ssh -X
并ssh -Y
失败并显示消息,
X11 转发请求在通道 0 上失败
我已经/etc/ssh/sshd_config
远程办理登机手续并且
X11Forwarding yes
已经到达。
编辑2
输出ssh -v -X [email protected] echo Hello world | grep -C 10 "X11 forwarding request failed"
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: exec
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Sending environment.
debug1: Sending env LC_PAPER = en_US.UTF-8
debug1: Sending env LC_ADDRESS = en_US.UTF-8
debug1: Sending env LC_MONETARY = en_US.UTF-8
debug1: Sending env LC_NUMERIC = en_US.UTF-8
debug1: Sending env LC_TELEPHONE = en_US.UTF-8
debug1: Sending env LC_IDENTIFICATION = en_US.UTF-8
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_MEASUREMENT = en_US.UTF-8
debug1: Sending env LC_TIME = en_US.UTF-8
debug1: Sending env LC_NAME = en_US.UTF-8
debug1: Sending command: echo Hello world
debug1: Remote: No xauth program; cannot forward with spoofing.
X11 forwarding request failed on channel 0
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 1 clearing O_NONBLOCK
Transferred: sent 3136, received 2800 bytes, in 0.3 seconds
Bytes per second: sent 9839.6, received 8785.3
debug1: Exit status 0