Xmanager串連Linux 9的方法

來源:互聯網
上載者:User

使用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了

此時如果選擇串連,會出現登陸視窗,然而輸入登陸使用者名稱密碼後並不能進入linux的案頭,會報一個session錯誤,說打不開某個font檔案,在此之前我在http://www.netsarang.com/網上了xmanager的中文片字元安裝檔案並進行了安裝chinese.exe,安裝後我在xconfig中設定了半天的font,始終沒有成功:

最後只好選擇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不能讀取:

後來實在沒辦法,又到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

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

其他文章:

檢查:
service iptables stop
然後
netstat -an|grep 177
netstat -an|grep 7100
netstat -an|grep 21
-----------------

在 /etc/hosts 裡面增加我的ip地址和主機名稱
xmanger可以登陸成功。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.