Centos中VNC遠端桌面程式的安裝與使用教程_伺服器其它

來源:互聯網
上載者:User

本文執行個體講述了Centos中VNC遠端桌面程式的安裝與使用方法。分享給大家供大家參考,具體如下:

這裡以centos 6.5為例

安裝GNOME案頭環境

yum groupinstall "X Window System" "Desktop"

CentOS安裝Xfce案頭環境,可選

yum groupinstall Xfce

安裝tigervnc

yum install tigervnc-server tigervnc

設定遠程登陸到gnome案頭的配置,再最後面加入如下兩行:

vim /etc/sysconfig/vncservers

VNCSERVERS="1:root"VNCSERVERARGS[1]="-geometry 1024x768 -alwaysshared -depth 24"

修改遠端桌面顯示設定檔:修改為以下內容並儲存

vim /root/.vnc/xstartup

#!/bin/sh# Uncomment the following two lines for normal desktop:unset SESSION_MANAGERexec /etc/X11/xinit/xinitrc[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresourcesxsetroot -solid greyvncconfig -iconic &xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &gnome-session & #set starting GNOME desktop#startkde & #kde desktop#twm & #Text interface#/usr/bin/startxfce4#exec /usr/bin/fluxbox

建立服務,執行多次則建多個服務,依次為 :1 :2 :3,每一次啟動時會提示設定密碼

vncserver

關閉具體的vncserver命令

vncserver -kill :1vncserver -kill :2

開機啟動

chkconfig vncserver on

防火牆 設定

當你啟動vnc服務後,你可以用netstat –tunlp命令來查看vnc服務所使用的連接埠,可以發現有5801,5901,6001等。使用下面命令開啟這些連接埠:
重啟防火牆:

# netstat –tunlpProto Recv-Q Send-Q Local Address    Foreign Address    State  PID/Program nametcp  0  0 0.0.0.0:5901    0.0.0.0:*     LISTEN  2092/Xvnctcp  0  0 0.0.0.0:111     0.0.0.0:*     LISTEN  1459/rpcbindtcp  0  0 0.0.0.0:6001    0.0.0.0:*     LISTEN  2092/Xvnctcp  0  0 0.0.0.0:22     0.0.0.0:*     LISTEN  1711/sshdtcp  0  0 127.0.0.1:631    0.0.0.0:*     LISTEN  1557/cupsd# vim /etc/sysconfig/iptables-A RH-Firewall-l-INPUT -p tcp -m tcp –dport 5801 -j ACCEPT-A RH-Firewall-l-INPUT -p tcp -m tcp –dport 5901 -j ACCEPT-A RH-Firewall-l-INPUT -p tcp -m tcp –dport 6001 -j ACCEPT# /etc/init.d/iptables restart

安裝Windows 用戶端:

http://sourceforge.net/projects/tigervnc/files/latest/download

啟動  TrigerVNC Viewer

輸入伺服器IP:01,例如:192.168.1.10:1

串連後再輸入每一次啟動vncserver時設定的密碼即可要串連到centos案頭了

希望本文所述對大家CentOS伺服器操作有所協助。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.