最近有一个项目,需要从Linux远程登录AIX主机运行某个程序,并将运行的图形化结果传送到本地Linux机器显示。
具体配置方法如下:
(1) 在Linux端使用ssh -Y remote_hostname 登录AIX。
(2) 修改其 /etc/ssh/sshd_config文件,加入以下一行
X11Forwarding yes
(3) 这样就完成了AIX机器上的ssh X转发的配置。可以使用xclock命令来测试。
以下是ssh部分参数的含义:
-X Enables X11 forwarding. This can also be specified on a per-host
basis in a configuration file.
X11 forwarding is subjected to X11 SECURITY extension restrictions
by default.
-Y Enables trusted X11 forwarding. Trusted X11 forwardings are not
subjected to the X11 SECURITY extension controls.
X11 FORWARDING
If the ForwardX11 variable is set to ``yes'' (or see the
description of the -X, -x, and -Y options above) and the
user is using X11 (the DISPLAY environment variable is set),
the connection to the X11 display is automatically forwarded
to the remote side in such a way that any X11 programs
started from the shell (or command) will go through the
encrypted channel, and the connection to the real X server
will be made from the local machine. The user should not
manually set DISPLAY. Forwarding of X11 connections can be
configured on the command line or in configuration files.
The DISPLAY value set by ssh will point to the server
machine, but with a display number greater than zero. This
is normal, and happens because ssh creates a ``proxy'' X
server on the server machine for forwarding the connections
over the encrypted channel.
ssh will also automatically set up Xauthority data on the
server machine. For this purpose, it will generate a random
authorization cookie, store it in Xauthority on the server,
and verify that any forwarded connections carry this cookie
and replace it by the real cookie when the connection is
opened. The real authentication cookie is never sent to the
server machine (and no cookies are sent in the plain).
If the ForwardAgent variable is set to ``yes'' (or see the
description of the -A and -a options above) and the user is
using an authentication agent, the connection to the agent
is automatically forwarded to the remote side.
以下介绍一下X-window
X Window System(常被简称为X11或X),是一套基于X display protocol的windowing system,X GUI环境的功能包括窗口的绘制、移动,以及与鼠标、键盘等输入设备的交互。X 协议当前版本为MIT在1987年9月制定的11版----这就是X11的来历,最新版则是2008年9月发布的X11R7.4。
X采用C/S模型:一个X server 和多个应用程序(client)通信。server接收client的请求绘制窗口,并将来自鼠标、键盘等设备的输入传递给client。
Linux主机上的应用程序被称为client,而用户终端计算机被称为server。X是从程序结构而非用户或硬件环境的角度来描述的,在用户终端上工作的X server为应用程序提供服务,所以被看作server,而远程主机上的应用程序接受服务,所以被看作client。
X server和client可以位于同一计算机上,例如在Linux上使用KDE等桌面环境就是这种模式。X server也可以通过同构网络、异构网络或Internet与client通信。
X server与client之间的通信是不加密的,这个问题可以通过SSH解决。SSH是Secure Shell的简称,SSH可以看作是通信被加密压缩版的telnet。我需要用到SSH的forwarding功能,当X server与client所在计算机都支持SSH协议时,X server与client之间不安全的TCP/IP连接可以转送到(forwarding)二者之间建立的SSH连接上。
--------------------------------------
Windows下使用Xming+putty远程显示X-window
(1) 安装Xming,使用缺省设置
(2) 设置Putty上Connection\SSH\X11:Enable X11 Forwarding,X display Location 为
localhost:0,这里的 0 就是配置 Xming X server 时指定的 Display Number。
阅读(1460) | 评论(0) | 转发(0) |