设置X11通过ssh转发

我试图设置x11转发来监视embedded式机器人平台上的video,但我似乎无法让电路板生成graphics输出。 我正在Beagleboard xM上运行Arch Linux,直接通过以太网连接(不过,我计划在未来使用WiFi)。 当我尝试设置DISPLAYvariables它将接受它,但是当我尝试运行一个x11应用程序是说:

(Object:287): Gtk-WARNING **: cannot open display: [displaynamehere] 

显然[displaynamehere]是我试图设置的显示器,但没有显示位置似乎工作。 有什么奇怪的是,每当我通过ssh -X连接,它不会给我任何错误,它不会保存我的DISPLAYvariables。

(编辑)我也检查了debugging日志,得到这个输出:

 debug2: load_server_config: filename /etc/ssh/sshd_config debug2: load_server_config: done config len = 315 debug2: parse_server_config: config /etc/ssh/sshd_config len 315 debug3: /etc/ssh/sshd_config:53 setting AuthorizedKeysFile .ssh/authorized_keys debug3: /etc/ssh/sshd_config:75 setting ChallengeResponseAuthentication no debug3: /etc/ssh/sshd_config:96 setting UsePAM yes debug3: /etc/ssh/sshd_config:101 setting X11Forwarding yes debug3: /etc/ssh/sshd_config:104 setting PrintMotd no debug3: /etc/ssh/sshd_config:108 setting UsePrivilegeSeparation sandbox debug3: /etc/ssh/sshd_config:124 setting Subsystem sftp /usr/lib/ssh/sftp-server debug1: sshd version OpenSSH_6.3, OpenSSL 1.0.1e 11 Feb 2013 debug3: Incorrect RSA1 identifier debug1: read PEM private key done: type RSA debug3: Incorrect RSA1 identifier debug3: Could not load "/etc/ssh/ssh_host_rsa_key" as a RSA1 public key debug1: private host key: #0 type 1 RSA debug3: Incorrect RSA1 identifier debug1: read PEM private key done: type DSA debug3: Incorrect RSA1 identifier debug3: Could not load "/etc/ssh/ssh_host_dsa_key" as a RSA1 public key debug1: private host key: #1 type 2 DSA debug3: Incorrect RSA1 identifier debug1: read PEM private key done: type ECDSA debug3: Incorrect RSA1 identifier debug3: Could not load "/etc/ssh/ssh_host_ecdsa_key" as a RSA1 public key debug1: private host key: #2 type 3 ECDSA debug1: rexec_argv[0]='/usr/bin/sshd' debug1: rexec_argv[1]='-ddd' debug3: oom_adjust_setup Set /proc/self/oom_score_adj from 0 to -1000 debug2: fd 3 setting O_NONBLOCK debug1: Bind to port 22 on 0.0.0.0. Bind to port 22 on 0.0.0.0 failed: Address already in use. debug2: fd 3 setting O_NONBLOCK debug3: sock_set_v6only: set socket 3 IPV6_V6ONLY debug1: Bind to port 22 on ::. Server listening on :: port 22. 

任何build议将不胜感激,我一直在尝试与谷歌近一个星期现在没有用。

非常感谢!

    在服务器上

     vim /etc/sshd_config AllowAgentForwarding yes AllowTcpForwarding yes X11Forwarding yes X11DisplayOffset 10 X11UseLocalhost no 

    重新启动sshd守护进程:

     service sshd restart yum -y update xauth apt-get -y update xauth yum -y install xauth apt-get -y install xauth 

    现在退出服务器:

     exit 

    设置本地的DISPLAY env var:

     export DISPLAY=:0.0 

    并调用服务器的可信SSH连接:

     ssh -Y $ssh_user@$ssh_server 

    用图形应用程序验证成功。 如果需要,安装支持X11转发的应用程序。 举个例子:

      yum -y install xclock 

    和行动!

      for i in {1..3} ; do bash -c "xclock &" ; done ; 

    ssh应该自动设置DISPLAY。 通常的嫌疑犯:在/ etc / ssh / sshd_config中缺少“X11Forwarding yes”

    调试你可以在客户端和服务器上运行详细模式,你可能会注意到一些东西:尝试在“服务器”端(调试模式,没有守护进程)

     $ /usr/sbin/sshd -d -p 222 

    在“客户”上:

     $ ssh -v -Y phil@192.168.0.14 -p 222 

    偶尔遇到一个奇怪的事情,比如“失踪xauth”…

    每当我遇到这个问题时,几乎总是跟着两个选项,我想你应该像下面那样对它们进行设置,然后再对你的配置做进一步的修改,比如设置DISPLAY等等。

     X11Forwarding yes X11UseLocalhost no