Xmanager连接Linux 9的方法

简介:

使用Xmanager2.0远程访问linux9方法。

此方法网络上面有相关描述,在此我做些补充:

2. XDMCP connection fails for Linux. How do I configure my Linux box?
How to configure Linux XDMCP(KDE/GNOME) settings for Xmanager
Affected Files
For runlevel:
/etc/inittab
For GDM:
/etc/X11/gdm/gdm.conf
For KDM:
/etc/X11/xdm/xdm-config
/etc/X11/xdm/Xaccess
/etc/X11/xdm/kdmrc
/usr/share/kdm/kdmrc
/usr/share/config/kdm/kdmrc
/etc/opt/kde2/share/config/kdm/kdmrc
For Firewall:
/etc/sysconfig/ipchains
Step 1. Change runlevel to enable gdm or kdm.
1. Open /etc/inittab file. 
2. Change the runlevel to 5 as following:
id:5:initdefault: 
Step 2. GDM configuration (When the Linux is using gdm)
1. Open /etc/X11/gdm/gdm.conf file. 
2. Go to the [xdmcp]section. 
3. Set the value of "Enable" option to "1". 
Step 3. KDM configuration (When the Linux is using kdm)
1. Open /etc/X11/xdm/xdm-config file. 
2. Comment out "requestPort" option as following:
DisplayManager.requestPort: 0
==>
!DisplayManager.requestPort: 0 
3. Open /etc/X11/xdm/Xaccess file. 
4. Remove the initial "#" character for the following line:
#* #any host can get a login window
==>
* #any host can get a login window 
5. Open /etc/X11/xdm/kdmrc, 
/usr/share/config/kdm/kdmrc or 
/etc/opt/kde2/share/config/kdm/kdmrc file. 
6. Change the value of "Enable" option to "true". 
Step 4. Firewall configuration (If the firewall has been configured)
1. Open /etc/sysconfig/iptables file. 
2. Add the following lines at the top of the file:
-A input -p udp -s 0/0 -d 0/0 177 -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 telnet -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 ssh -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 login -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 exec -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 shell -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 7100 -j ACCEPT 
Step 5. Restart your Linux to activate the changes.
此处是设置由于ip限制访问不了x的问题

Setup 3的第5和Setup 4的第二步都比较重要,一般教程上都没有提及,这里要特别关注。

此时已经可以连上X了

clip_image002.jpg

此时如果选择连接,会出现登陆窗口,然而输入登陆用户名密码后并不能进入linux的桌面,会报一个session错误,说打不开某个font文件,在此之前我在http://www.netsarang.com/网上了xmanager的中文片字符安装文件并进行了安装chinese.exe,安装后我在xconfig中设置了半天的font,始终没有成功:

clip_image003.jpg

最后只好选择add font server,此时发现之前我打开过7100的端口,觉得应该能从服务器上下载中文字集。

不过始终无法连接到服务器。

我查看了一下/etc/sysconfig/iptables 的设置:

发现:

-A RH-Lokkit-0-50-INPUT -i lo -j ACCEPT
-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 0:1023 --syn -j REJECT
-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 2049 --syn -j REJECT
-A RH-Lokkit-0-50-INPUT -p udp -m udp --dport 0:1023 -j REJECT
-A RH-Lokkit-0-50-INPUT -p udp -m udp --dport 2049 -j REJECT
-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 6000:6009 --syn -j REJECT
-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 7100 --syn -j REJECT 
-A input -p udp -s 0/0 -d 0/0 177 -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 telnet -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 ssh -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 login -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 exec -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 shell -j ACCEPT
-A input -p tcp -s 0/0 -d 0/0 7100 -j ACCEPT

发现下面一句:

-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 7100 --syn -j REJECT 
说明我的7100被禁了

将其用#注释掉

保存,再用xmanager连接,已经不报连接不上了,说明端口已经可以访问了。

然而还是进不了X,报一个.pinyi的font不能读取:

clip_image004.jpg

后来实在没办法,又到http://www.netsarang.com/products/xmg_faq.html拜读了一下里面的说明,累死了~~全英文的:

突然我发现有这么一个介绍:

14. Gnome terminal fails to open in RedHat 7.3.

The problem occurs due to the font used by gnome-terminal.

To fix this problem, configure xfs program and add the specific font server into the font list of Xconfig.

  1. Comment the following line out in the file /etc/X11/fs/config.
    #no-listen = tcp
  2. Restart xfs process or reboot the system.
  3. Open Xconfig utility.
  4. Choose Font tab.
  5. Click Add Font Server button.
  6. In the Host box, enter the hostname or IP address of Linux.
  7. In the Port box, enter 7100.
  8. Restart Xmanager.

Make sure that the font server should be listed in the bottom of the font list.

根据要求加上#号

重新启动xfs,在linux中输入:

$service xfs restart

通过xmanager2.0再次进入,发现漂亮的linux桌面

此处还有个小问题,由于之前我在root的环境变量文件.bash_profile中加了

export DISPLAY=192.168.1.XXX

因此进入xwindow中之前还会报个错,查看刚才那个文档有以下说明:

因此加#注释掉就行:

24. I entered correct username and password in the login screen but the remote desktop is still not displayed.

When the DISPLAY variable is manually assigned, the remote machine may not find X server (Xmanager). DISPLAY variable is set automatically by Xmanager so you do not need to manually assign it.

Please check your login script (.cshrc, .profile, .login, .bashrc, and etc) and comment out the line that starts with "export DISPLAY..." or "setenv DISPLAY..." as the following statements.

# export DISPLAY=192.168.1.XXX
# setenv DISPLAY 192.168.1.XXX

clip_image006.jpg

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

其他帖子:

检查:
service iptables stop
然后
netstat -an|grep 177
netstat -an|grep 7100
netstat -an|grep 21
-----------------

在 /etc/hosts 里面增加我的ip地址和主机名
xmanger可以登陆成功。




本文转自斯克迪亚博客园博客,原文链接:http://www.cnblogs.com/sgsoft/archive/2007/05/17/750607.html,如需转载请自行联系原作者

相关文章
|
18小时前
|
移动开发 监控 网络协议
linux如何查看websocket的连接
linux如何查看websocket的连接
|
1天前
|
Oracle Java 关系型数据库
【服务器】python通过JDBC连接到位于Linux远程服务器上的Oracle数据库
【服务器】python通过JDBC连接到位于Linux远程服务器上的Oracle数据库
13 6
|
1天前
|
Linux 网络安全
xmanager 4 连接SuSE linux server 11方法
xmanager 4 连接SuSE linux server 11方法
|
1天前
|
Linux
【Linux】命名管道的创建方法&&基于命名管道的两个进程通信的实现
【Linux】命名管道的创建方法&&基于命名管道的两个进程通信的实现
|
4天前
|
Shell Linux 编译器
C语言,Linux,静态库编写方法,makefile与shell脚本的关系。
总结:C语言在Linux上编写静态库时,通常会使用Makefile来管理编译和链接过程,以及Shell脚本来自动化构建任务。Makefile包含了编译规则和链接信息,而Shell脚本可以调用Makefile以及其他构建工具来构建项目。这种组合可以大大简化编译和构建过程,使代码更易于维护和分发。
22 5
|
5天前
|
Shell Linux 编译器
C语言,Linux,静态库编写方法,makefile与shell脚本的关系。
总结:C语言在Linux上编写静态库时,通常会使用Makefile来管理编译和链接过程,以及Shell脚本来自动化构建任务。Makefile包含了编译规则和链接信息,而Shell脚本可以调用Makefile以及其他构建工具来构建项目。这种组合可以大大简化编译和构建过程,使代码更易于维护和分发。
14 3
|
14小时前
|
安全 网络协议 Linux
linux必学的60个命令
Linux是一个功能强大的操作系统,提供了许多常用的命令行工具,用于管理文件、目录、进程、网络和系统配置等。以下是Linux必学的60个命令的概览,但请注意,这里可能无法列出所有命令的完整语法和选项,仅作为参考
|
16小时前
|
监控 Linux 数据处理
|
16小时前
|
编解码 Ubuntu Linux
|
22小时前
|
JSON Linux 数据格式
Linux命令发送http
请注意,`curl`命令非常灵活,可以根据您的需求进行多种配置和自定义。您可以查看 `curl`命令的文档以获取更多详细信息。
4 0