Linux 无法打开 x11 显示器:无法连接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14540457/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
failed to open the x11 display : unable to connect
提问by alrightgame
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. Any straightforward advice and help would be appreciated.
我不知道显示变量在哪里,因为我对 linux 很陌生。任何直接的建议和帮助将不胜感激。
采纳答案by Edu
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). 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
.
也可以通过在配置文件 (~/.ssh/config) 中将“ForwardX11”设置为“yes”来启用每个主机。还需要在目标服务器的 sshd 配置文件 (/etc/ssh/sshd_config) 中使用选项启用对 X11 转发的支持X11Forwarding yes
。
You should also know that there are some security implications in enabling the X11 forwarding. Read more from ssh and sshd man pages or here. If you control both server and client and trust both equally, there shouldn't be any problem in enabling the forwarding.
您还应该知道启用 X11 转发有一些安全隐患。从 ssh 和 sshd 手册页或此处阅读更多内容。如果您同时控制服务器和客户端并平等信任两者,则启用转发应该没有任何问题。