CentOS6.4下VNC Server最簡配置

bgn4 9年前發布 | 13K 次閱讀 CentOS

CentOS6.4下VNC Server最簡配置

    環境:

    CentOS 6.4 Final,桌面安裝了除KDE的所有組件

    1、安裝服務

    yum install tigervnc-server

    名字有點怪哦,CentOS5前叫vnc-server

    2、運行并設置密碼

    vncserver :1

    輸入密碼,會生成相關的文件

    xauth: creating new authority file /root/.Xauthority

    New 'centos6-244:1 (root)' desktop is centos6-244:1

    Starting applications specified in /root/.vnc/xstartup

    Log file is /root/.vnc/centos6-244:1.log

    3、配置用戶

    vim /etc/sysconfig/vncservers

    最后一行加入:

    VNCSERVERS="1:root" 多個用戶用空格分開,并要先su - 到那個用戶運行vncserver :n來設定配置文件和密碼

    4、實用命令

    usage: vncserver [:] [-name ] [-depth ]

    [-geometry x]

    [-pixelformat rgbNNN|bgrNNN]

    [-fp ]

    [-fg]

    ...

    vncserver -kill

    vncserver -list

    vncserver[:n]開服務

    vncserver -list看有幾個在運行

    vncserver -kill :n 殺掉第幾個x-display

    vncpasswd     修改密碼

    5、服務管理

    service vncserver restart

    其它用法:/etc/init.d/vncserver {start|stop|restart|try-restart|status|force-reload}

    chkconfig vncserver on 加入到自啟動(chkconfig --level 35 vncserver on)

    6、客戶端連接

    CentOS:使用TigerVNC Viewer 連接 ip:1

    Windows:使用Real VNC Viewer 連接ip:1

    輸入密碼即可訪問



關閉虛擬機防火墻:

關閉命令:  service iptables stop

永久關閉防火墻:chkconfig iptables off

兩個命令同時運行,運行完成后查看防火墻關閉狀態
service iptables status

1 關閉防火墻-----service iptables stop 
2 啟動防火墻-----service iptables start 
3 重啟防火墻-----service iptables restart 
4 查看防火墻狀態--service iptables status 
5 永久關閉防火墻--chkconfig iptables off 
6 永久關閉后啟用--chkconfig iptables on

客戶端工具

http://www.realvnc.com/download/viewer/

 本文由用戶 bgn4 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!