SSH服务器拒绝X11转发请求

SSH服务器拒绝X11转发请求

我已经在超级用户上问过这个问题,但问题还没有解决。这个问题确实困扰着我。我在网上搜索了很长时间。但没有用。请帮助或尝试给出一些如何实现这一目标的想法。

超级用户问题--关联

环境:centos 7、xshell、xmanager。

我有两台centos7虚拟机,其中一台可以通过SSH会话中的X11转发成功打开Chrome浏览器,但另一台则不能。

正常的:

[root@localhost ~]# google-chrome --no-sandbox
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
[16458:16458:0523/075723.020611:ERROR:gl_surface_glx.cc(419)] GLX 1.3 or later is required.
[16458:16458:0523/075723.020636:ERROR:gl_initializer_x11.cc(153)] GLSurfaceGLX::InitializeOneOff failed.
[16458:16458:0523/075723.022497:ERROR:gpu_child_thread.cc(254)] Exiting GPU process due to errors during initializat
[16393:16422:0523/075723.081833:ERROR:browser_gpu_channel_host_factory.cc(108)] Failed to launch GPU process.
[root@localhost ~]# [0523/075728.166795:ERROR:nacl_helper_linux.cc(310)] NaCl helper process running without a sandb
Most likely you need to configure your SUID sandbox correctly

不正常的一类:

WARNING! The remote SSH server rejected X11 forwarding request.

[root@yxs ~]# google-chrome --no-sandbox

(google-chrome:10346): Gtk-WARNING **: cannot open display: 
[root@yxs ~]# [0523/202401.444038:ERROR:nacl_helper_linux.cc(310)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly
^C
[root@yxs ~]# su yxs
[yxs@yxs root]$ google-chrome

(google-chrome:10407): Gtk-WARNING **: cannot open display: 

两者下面的配置几乎是一样的。

正常的:

[root@localhost ~]# cat /etc/ssh/sshd_config | grep X11
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#   X11Forwarding no
[root@localhost ~]# rpm -qa | grep xauth
xorg-x11-xauth-1.0.9-1.el7.x86_64
[root@localhost ~]# ssh -V
OpenSSH_6.6.1p1, OpenSSL 1.0.1e-fips 11 Feb 2013
[root@localhost ~]# cat /etc/redhat-release 
CentOS Linux release 7.3.1611 (Core) 
[root@localhost ~]# echo $DISPLAY
localhost:10.0

#enable ipv6
#minimal centos

不正常的一类:

[root@yxs ~]# cat /etc/ssh/sshd_config | grep X11
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#   X11Forwarding no
[root@yxs ~]#  rpm -qa | grep xauth
xorg-x11-xauth-1.0.9-1.el7.x86_64
[root@yxs ~]# ssh -V
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
[root@yxs ~]# echo $DISPLAY

[root@yxs ~]#

#disbale ipv6
#has installd "GNOME Desktop"

export DISPLAY=localhost:10.0我尝试在异常的虚拟机上执行,但是当我重新启动时,环境变量$DISPLAY又变成空了。

我只是无法google-chrome --no-sandbox通过 Xshell 中的 SSH 会话通过命令打开 Chrome。但我可以正常使用通过VNC窗口对虚拟机进行管理。

答案1

就因为我禁用了IPv6,所以需要添加AddressFamily inet/etc/ssh/sshd_config.之前太粗心了。对不起。

第三个答案:关联

相关内容