RHEL6.1 中VNC部署

来源:互联网 发布:ie8中文版官方mac 编辑:程序博客网 时间:2024/06/05 09:14

1、首先安装vnc的服务器端

        yum install tigervnc-server

2、启动vnc服务

       运行vncserver或者service vncserver start

      

       New 'was1.com:1 (root)' desktop is was1.com:1

       Starting applications specified in /root/.vnc/xstartup
       Log file is /root/.vnc/was1.com:1.log

 

       设置远程登录密码,不要使用小键盘,在vncpasswd下小键盘的作用相当于上下左右,没有数字功能,切记

3、修改/etc/sysconfig/vncservers

      # The VNCSERVERS variable is a list of display:user pairs.
      # Uncomment the lines below to start a VNC server on display :2
      # as my 'myusername' (adjust this to your own).  You will also
     # need to set a VNC password; run 'man vncpasswd' to see how
     # to do that.
     # DO NOT RUN THIS SERVICE if your local area network is
     # untrusted!  For a secure way of using VNC, see this URL:
    # http://kbase.redhat.com/faq/docs/DOC-7028

    # Use "-nolisten tcp" to prevent X connections to your VNC server via TCP. 

    # Use "-localhost" to prevent remote VNC clients connecting except when
    # doing so through a secure tunnel.  See the "-via" option in the
    # `man vncviewer' manual page.

    # VNCSERVERS="2:myusername"

     # VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"

     VNCSERVERS="1:root 2:test"
     VNCSERVERARGS[2]="-geometry 800x600"

可以复制

    # VNCSERVERS="2:myusername"

     # VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"

这两行配置进行修改。其中geometry 800x600 意思为以800*600的分辨率远程桌面 ;nolisten tcp 不侦听tcp localhost为只允许本地主机连接

修改配置完重启服务service vncserver restart

4、在客户端安装vnc

windows用户可直接下载安装vnc

linux需要安装tigervnc

vncviewer root@服务器地址:1或者2

5、在服务器上设置vncserver开机自启动

chkconf  vncserver on

6最后一点:开通vnc的服务器一定要设置防火墙,关闭防火墙。。。

原创粉丝点击