LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1187|回复: 4

How can I open the terminal tcsh display on local X11 display

[复制链接]
发表于 2008-7-30 02:00:35 | 显示全部楼层 |阅读模式
I use ssh to log on to the Linux server. The default terminal on this Linux server is -tcsh, and my local terminal is -bash, GUI is X11.

So how can I transfer the server display to my local X11 display?

Thank you so much.
发表于 2008-7-30 12:37:44 | 显示全部楼层
你直接ssh上面,它那边是什么sh,你就用什么sh啊?不明白你要干嘛
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-30 23:50:05 | 显示全部楼层
就是把服务器上的GUI程序(比方说Gedit)显示在本地机上啊,因为不经过设置的话,总是会出现 unable to open display。
服务器上我说了是 -tcsh, 本地我也说了是 -bash

难道还没有说轻楚吗?

我记得以前我同事用 xhost + 什么的,我现在忘记了。

多谢兄弟关注。
回复 支持 反对

使用道具 举报

发表于 2008-7-30 23:58:50 | 显示全部楼层
你是用 ssh 吗? 如果是的话, ssh -Y user@hostname 登陆,然后就可以直接回传 X 程序的输出过来了,如果不是 ssh, 就要先在本地端 "xhost +" 一下,然后登陆服务器,在 tcsh 里面用 setenv 设定 DISPLAY 变量为 本地机IP:0  (bash 用 export DISPLAY=本地机IP:0)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-31 00:32:49 | 显示全部楼层
Post by lazyfai;1880440
你是用 ssh 吗? 如果是的话, ssh -Y user@hostname 登陆,然后就可以直接回传 X 程序的输出过来了,如果不是 ssh, 就要先在本地端 "xhost +" 一下,然后登陆服务器,在 tcsh 里面用 setenv 设定 DISPLAY 变量为 本地机IP:0  (bash 用 export DISPLAY=本地机IP:0)


多谢兄弟,好使。我整理了一下:

Q022. How can I open the server GUI display on local X11 display (using SSH terminal or not)?

A022.
Enables trusted X11 forwarding.

Case A: Local is Linux, using SSH to connect to the server
##########################################################
- ssh -Y user@hostname

Case B: Local is Windows, using PuTTY (SSH) to connect to the server
##########################################################
(1) Install Xming server (http://www.straightrunning.com/XmingNotes/);
(2) Turn on the Xming server from "Start --> Xming --> Xming";
(3) Run PuTTY and configure it as:
    a) Session --> Host Name (or IP address), Port: 22
    b) Session --> Connection type: SSH
    c) Connection --> SSH --> X11 --> Enable X11 forwarding: Checked
(4) Done.

Case C: Local is Linux, using non-SSH to connect to server
##########################################################
      local > xhost +
      local > (connect to user@hostname using non-SSH)
server-tcsh > setenv DISPLAY LocalIP:0
OR:
server-bash > export DISPLAY=LocalIP:0

More see also:
http://www.peterlee.com.cn/blog.php?getArticleID=53
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表