[转]Xmanager/X-win32 连接Redhat Linux as5

环境要求1.客户端利用xmanager3.0连接服务器可以看到和本机登录一样的图形界面2.允许root远程连接登录 相关配置文件介绍1./usr/share/gdm/defaults.conf---- GNOME管理默认的配置文件2./etc /inittab---init进程的主配置文件3./etc /gdm/custom.conf---GNOME的自定义配置文件 服务器配置1.改变defaults.conf文件权限,默认是只读chmod 700 /usr/share/gdm/defaults.conf

2.做如下配置---编辑/usr /share/gdm/defaults.conf

Enable=true

DisplaysPerHost=10

Port=177

AllowRoot=true

AllowRemoteroot=true

AllowRemoteAutoLogin=false

3.做如下配置---编辑 /etc/gdm/custom.conf

[xdmcp]

Enable=1

4.做如下配置---编辑 /etc/inittab(不要修改原来设置,在最后新增一行如下记录)    x:5:respawn:/usr/sbin/gdm 5.重新加载GNOME桌面配置   init 3 ; init 5

rhel5与rhel4不同的地方是,rhel5里没有 /etc/X11/gdm/这个目录,rhel5的gdm的配置文件放在这里/usr/share/gdm /defaults.comf,这一点可能是困扰大家的地方。

在/usr/share/gdm/defaults.conf里确保有以下几句配置:

  1. Enable=true
  2. DisplaysPerHost=10
  3. Port=177
复制代 码

在/etc/inittab里把默认级别改为5:
id:5:initdefault:

再在这个文件里加一句:
x:5:respawn:/usr/sbin/gdm

然后重启系统。然后在windows系统上运行 xmanager2里的Xbrowser程序,在里面新建一个Xmanager Session,在Host这里输入ip地址,其它配置都不要改变(包括端口号),确定退出。然后双击这个New Xmanager Session,看到登录界面:
remove-login-to-rhel5-gdm.JPG下载 (56.33 KB)
2008-01-14 14:05

输入用户名和密码以后就可以登录到gnome。
rhel5-gdm-desktop.JPG下载 (130.74 KB)
2008-01-14 14:05

因为是远程的关系,所以速度有一些慢。
更简单的方法是直接用gdmsetup命令修改gnome的配置。


在我的rhel5 desktop上同样可以远程登录到rhel5 server上的gnome桌面。操作过程:
在desktop上的终端里执行命令:
X :1 -quiet -query 192.168.20.2 &

注:这个命令可以在字符终端里执行,也可以在gnome里开个终端执行。
如果登录有问题,需要在server上执行xhost +命令,更安全的做法请参考xhost的语法,我用xhost +命令只是图个方便。

在第8个终端上会出现server上gnome的登录界面,和windowsxp 的xmanager下看到的是一样的。
按ctrl+alt+F7切换回desktop本机的gnome桌面,按ctrl+alt+F8切换到Server的gnome桌面,感觉非常Cool! 第一次体会到Xwindow的伟大!

    过xmanager远程连接redhat linux as 5

rhel5与rhel4不同的地方是,rhel5里没有/etc/X11/gdm/这个目录,rhel5的gdm的配置文件放在这里/usr/share /gdm/defaults.conf。
需要修改的地方如下:
修改/usr/share/gdm/defaults.conf文件,确保里面有以下几行:
Enable=true
DisplaysPerHost=10
Port=177
再修改/etc/inittab文件,把默认级别改为5,再加入以下行:
x:5:respawn:/usr/sbin/gdm
这样修改后,root用户还不能登录,还要继续修改/usr/share/gdm/defaults.conf文件,具体如下(红色部分):
[security]
# Allow root to login.  It makes sense to turn this off for kiosk use, when
# you want to minimize the possibility of break in.
AllowRoot=true
# Allow login as root via XDMCP.  This value will be overridden and set to
# false if the /etc/default/login file exists and contains
# "CONSOLE=/dev/login", and set to true if the /etc/default/login file exists
# and contains any other value or no value for CONSOLE.
AllowRemoteRoot=true
如果防火墙打开了,使用以下命令打开177端口:
iptables -A INPUT -p udp --dport 177 -j ACCEPT
用gdm-binary -daemon 启动, 177端口


XDMCP连接到Red Hat 5 EL 和 CentOS 5
1. XDM 配置
1. 改变运行级别到5

打开/etc/inittab 然后设置init运行级别5:
id:5:initdefault:

再在这个文件里加一句:
x:5:respawn:/usr/sbin/gdm
2.打开XDMCP

对GDM:
打开/etc/gdm/custom.conf 设置Enable为1在[xdmcp]的选项中.
[xdmcp]
Enable=1

打开 /usr/share/gdm/defaults.conf设置

查找“[xdmcp]”
把Enable选项由“false”设置“true”
设置“DisplayPerHost”为9
设置Port=177

[xdmcp]
Enable=true

对KDM:
打开/usr/share/config/kdm/Xaccess和 remove the initial "#" character for the following line:
#* #any host can get a login window ==>
* #any host can get a login window
Open /usr/share/config/kdm/kdmrc and set the Enable entry to true in the [xdmcp] section as following.
[xdmcp]
Enable=true


2.防火墙(TCP/UDP Ports)配置
在你的防火墙打开UDP端口177到服务器.

iptables -I INPUT -p udp --dport 177 -j ACCEPT
在你的防火墙打开TCP端口从6000~6010,一定要保证从远程到你的服务器可以直接打开

3. 重起你的主机然后开始Xmanager
# init 3; init 5


下面的测试在As5.4不通过

1、#vi /etc/X11/xdm/Xaccess
找到
# * #any host can get a login window
去掉“#”

2、#vi /etc/X11/gdm/gdm.conf
查找“[xdmcp]”
把Enable选项由“false”设置“true”
设置“DisplayPerHost”为9
设置Port=177

3、#vi /etc/inittab
把启动的级别改为“5”,这样才能启动x-windows
id:5:initdefault:
在最后添加
x:5:respawn:/usr/bin/gdm

重新启动Linux

4、在xmanage中新建xmanage session,选项“Connection Method”为“XDM Query”,设置HOST,端口默认为177,然后连接。
5、在X-win32中新建一个会话,类型选择“XDMCP”,XDMCP连接方式选择“查询”,填写HOST IP,然后连接。

XMANAGER 连接到REDHAT AS 5


1。 在笔记本上面装个x-server,xmanage/exceed/xdeep/cygwin 均可
2。 启动x-server至 passive 模式 (这个根据不同x-server软件有不同做法)
3。 以Oracle用户登陆到你要装Oracle的机器上,设置DISPLAY
export DISPLAY=192.168.0.152:0.0 (IP是笔记本的IP)
4. xclock 看看是否在本机的x-server上显示小钟,有了就OK了

或者可能不知道如何启动passive 模式:
1。 在笔记本上面装个x-server,xmanage/exceed/xdeep/cygwin 均可
2。 启动x-server , 用broadcast, 选择登陆的机器
3。 以Oracle用户用图形界面登陆到你要装Oracle的机器上,设置DISPLAY
export DISPLAY=192.168.0.152:0.0 (IP是笔记本的IP)
4. xclock 看看是否在本机的x-server上显示小钟,有了就OK了

下面附件文档,测试不行

一、 XMANAGER 连接到REDHAT AS 5 需要修改的地方。

rhel5与rhel4不同的地方是,rhel5裡没有/etc/X11/gdm/这个目录,rhel5的gdm的配置文件放在这裡/usr/share/gdm/defaults.comf,这一点可能是困扰大家的地方。

在/usr/share/gdm/defaults.conf裡确保有以下几句配置:

Enable=true
DisplaysPerHost=10
Port=177
在/etc/inittab裡把默认级别改為5:
id:5:initdefault:

再在这个文件裡加一句:
x:5:respawn:/usr/bin/gdm

然后重啟系统。然后在windows系统上运行xmanager2裡的Xbrowser程序,在裡面新建一个Xmanager Session,在Host这裡输入ip地址,其它配置都不要改变(包括端口号),确定退出。然后双击这个New Xmanager Session,看到登录界面

二、 如果允许Root用户连接到XMANAGER 需要修改以下内容:


# vi defaults.conf

[security]
# Allow root to login. It makes sense to turn this off for kiosk use, when
# you want to minimize the possibility of break in.
AllowRoot=true
# Allow login as root via XDMCP. This value will be overridden and set to
# false if the /etc/default/login file exists and contains
# "CONSOLE=/dev/login", and set to true if the /etc/default/login file exists
# and contains any other value or no value for CONSOLE.
AllowRemoteRoot=true
# This will allow remote timed login.
AllowRemoteAutoLogin=false
# 0 is the most restrictive, 1 allo


#vi /etc/securetty
......
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11
pts/0
pts/1
pts/2
pts/3
pts/4

添加这一些。


# vi /etc/pam.d/login

#%PAM-1.0
#auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth       include      system-auth
account    required     pam_nologin.so
account    include      system-auth
password   include      system-auth
# pam_selinux.so close should be the first session rule
session    required     pam_selinux.so close
session    include      system-auth
session    required     pam_loginuid.so
session    optional     pam_console.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session    required     pam_selinux.so open
session    optional     pam_keyinit.so force revoke


#vi /etc/pam.d/remote

#%PAM-1.0
#auth       required     pam_securetty.so
auth       include      system-auth
account    required     pam_nologin.so
account    include      system-auth
password   include      system-auth
# pam_selinux.so close should be the first session rule
session    required     pam_selinux.so close
session    include      system-auth
session    required     pam_loginuid.so
session    optional     pam_console.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session    required     pam_selinux.so open
session    optional     pam_keyinit.so force revoke

#vi /etc/xinetd.d/telnet

# default: on
# description: The telnet server serves telnet sessions; it uses \
#       unencrypted username/password pairs for authentication.
service telnet
{
flags           = REUSE
socket_type     = stream
wait            = no
user            = root
server          = /usr/sbin/in.telnetd
log_on_failure += USERID
disable         = no
}

-------------------------------------------------------------------------------------------------------------------------

1、在X window执行"system"-"administration"-"login screen"。
2、在"remote panel"选择"same as local"。
如果您希望root用户可以登录,在"security panel"选择"allow remote system administrator login"
3、重启系统。

posted on 2010-01-13 10:46  dhj  阅读(175)  评论(0编辑  收藏  举报

导航