2013-08-05 30 views
2

我有一个有趣的问题 - 在Windows上使用Xming我可以成功地将X11请求转发到我的客户端(PC),并且可以运行这些应用程序。不过,我最近在我的电脑上安装了Ubuntu 13.04,不知何故我无法完成工作。X11在Ubuntu上转发错误,虽然它在Windows上工作

我的/ etc/SSH/ssh_config中有下面几行:

Host * 
ForwardAgent yes 
ForwardX11 yes 

,我尝试使用以下命令连接:

ssh -X -v [email protected] 

详细输出显示我:

X11 forwarding request failed on channel 0 

我也执行了xhost +来禁用客户端上的所有访问控制,但奇怪的是在我的客户DISPLAY变量设置为:0,我不能用其他任何东西如localhost:0甚至$Local_IP:0替换它,当我这样做,X11将无法正常工作,请参阅下面的示例输出 - 我怀疑这可能会导致答案:

[email protected]:~$ export DISPLAY=localhost:0 # $localip:0 doesn't work either 
[email protected]:~$ emacs 
Display localhost:0 unavailable, simulating -nw 
[email protected]:~$ 
+0

不是一个真正的编程问题,试着询问[SuperUser](http://superuser.com/)或[ServerFault](http://serverfault.com/) – 2013-08-05 14:51:18

+0

@ user2062950感谢重定向,我克隆了它超级用户(http://superuser.com/questions/628480/x11-forwarding-error-on-ubuntu-client-though-it-works-on-windows),让我们保留这个参考。 – Koray

回答

2

我解决了它 - 这是一个身份验证问题。执行服务器上以下行解决了这个问题:

$ xauth add ${client_ip}:0 . ${hex_key} 
xauth: creating new authority file /homes/${username}/.Xauthority 

其中${client_ip}是X服务器运行客户端,${hex_key}是32个字符的十六进制字符串。之后,在确定env变量$DISPLAY后,我现在可以成功连接了。

相关问题