简体   繁体   English

无法打开x11显示屏:无法连接

[英]failed to open the x11 display : unable to connect

The server that supports the graphical display is different from the server I'm sshed into. 支持图形显示的服务器与我遇到的服务器不同。 When I try to open virtualbox, I get this message. 当我尝试打开virtualbox时,我收到此消息。

$ Failed to open the X11 display!  

When I try to startx, I get three error messages. 当我尝试startx时,我收到三条错误消息。

$ PAM authentication failed, cannot start X server

$ giving up.
$ xinit:  No such file or directory (errno 2):  unable to connect to X server
$ xinit:  No such process (errno 3):  Server error.

I don't know where the display variable is, as I'm very new to linux. 我不知道显示变量在哪里,因为我对linux很新。 Any straightforward advice and help would be appreciated. 任何直截了当的建议和帮助将不胜感激。

Give option -X on command line to enable X11 forwarding (graphical interfaces). 在命令行上提供选项-X以启用X11转发(图形界面)。

ssh -X user@hostname

It can be also enabled per host basis by setting "ForwardX11" to "yes" in configuration file (~/.ssh/config). 通过在配置文件(〜/ .ssh / config)中将“ForwardX11”设置为“yes”,也可以按主机启用它。 Support for X11 forwarding needs to be also enabled in the target server's sshd configuration file (/etc/ssh/sshd_config) with option X11Forwarding yes . 还需要在目标服务器的sshd配置文件(/ etc / ssh / sshd_config)中启用对X11转发的支持,并选择X11Forwarding yes

You should also know that there are some security implications in enabling the X11 forwarding. 您还应该知道启用X11转发会有一些安全隐患。 Read more from ssh and sshd man pages or here . 阅读ssh和sshd手册页或此处的更多内容 If you control both server and client and trust both equally, there shouldn't be any problem in enabling the forwarding. 如果您同时控制服务器和客户端并同时信任,则启用转发应该没有任何问题。

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

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