1. 程式人生 > >Xdmcp連接失敗解決步驟

Xdmcp連接失敗解決步驟

set -a selinux netstat conf ORC host running connect

搗鼓了好幾天終於解決Xdmcp連接失敗問題,
把答案貼在這兒供參考:

首先,先貼下網上找到的檢查步驟:

1、是否有dtlogin,KDM,GDM或XDM程序在遠程主機上運行?
2、遠程主機上是否顯示登錄窗口?
3、遠程主機是否使用的是另一個網絡?
4、遠程主機跟用戶電腦之間是否有防火墻?
5、用戶電腦中是否設置了防火墻?
6、名稱服務器中保存的用戶地址是否是錯誤的?
7、你的shell腳本(比如/etc/profile之類)中是否配置了錯誤的DISPLAY變量值。

英文版:
1.Check the following:
★Is a dtlogin, kdm, gdm or xdm is running on the remote host?

★Does the login window open?
★Is the remote host on a different network?
★Is there a firewall between your Windows and the remote host?
★Does your Windows system have a firewall configuration?
★The name server may have an incorrect entry for your PC.
★The DISPLAY variable is configured incorrectly on your shell script.

2.See log messages.
★To see Xmanager log files, click the system menu on Xmanager main window, point to Log, and then click File.
★For CDE errors, read /var/dt/Xerrors when you cannot see the login window.
Read $HOME/.dt/startlog and $HOME/.dt/errorlog when you failed to login.

To solve Xstart connection problems:

1.Run Xstart.
2.Select Show status dialog box.
3.Select Show reply messages.
4.Click Run. RESULT: A Reply Messages dialog box opens.
5.Read the reply messages to find the reason of the problem.

要知道是否有dtlogin,KDM,GDM或XDM程序在遠程主機上運行,
請用root賬號查看gdm是否在177端口等待
netstat -tulnp | grep 177
看到udp和udp6表示gdm啟動成功

你的Windows上有沒有server在6000端口等待?
netstat -aon | findstr 177
看到0.0.0.0:6000 表示windows上的xserver啟動成功
一般xserver是xdmcp的client端啟動的,我用的是mobaxterm,它自動啟動xserver。

到此,若xdmcp仍連線失敗,多半是網絡問題,
即linux透過網絡找不到你的主機
一般有以下兩種情況
1.windows或linux或兩者之間有防火墻,把他們全關掉
2.linux無法透過你的主機名來連你

以下列三方法解決:

一、Windows的網卡ip要單純,
1.千萬不要有多網卡,尤其要禁用vmware的虛擬網卡(重要、重要);
2.確定跟linux在同一網段
3.網卡中不要有多個ip,如果有多個請刪掉其他留下一個;

二、關閉Windows和Linux兩端的防火墻

註意,linux上的防火墻除iptables,firewall外,還有SE Linux
Linux端不可以開啟“SE Linux”,如果開啟,請關閉它
/usr/sbin/sestatus命令可以查SE的狀態,如果SELinux status: enabled表示他是開啟的
臨時關閉:setenforce 0
永久關閉:將/etc/selinux/config文件中的SELINUX=enforcing改為SELINUX=disabled

三、用who命令看看linux認為你的主機叫什麽,如果不是ip,則在linux的/etc/hosts添加:
你的主機ip 你的主機名(即who上那個主機名)
從linux ping windows (用ip和名字都ping一次)看看是否能夠正確的從linux找到你的windows

Xdmcp連接失敗解決步驟