vncserver创建与客户端连接

1. 确认服务器端是否安装了vncserver

Vnc相关依赖包

gtk-vnc-python-0.3.2-3.el5

vnc-server-4.1.2-14.el5

gtk-vnc-0.3.2-3.el5

vnc-4.1.2-14.el5

   [root@localhost: ~]#rpm -q gtk-vnc-python vnc-server gtk-vnc vnc

 

2. 创建VNCSERVER服务:
      [root@localhost /]# vncserver

You will require a password to access your desktops.

Password:     输入vnc 连接密码

Verify:       确认vnc密码

xauth:  creating new authority file /root/.Xauthority

New 'localhost.localdomain:1 (root)' desktop is localhost.localdomain:1

Creating default startup script. /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log

   查看已经启动的vncserver

      Ps –ef|grep vnc

 

3. 修改配置文件,实现图形化连接

      修改~/.vnc/xstartup,添加对应的行:

       #!/bin/sh

# Uncomment the following two lines for normal desktop:

# unset SESSION_MANAGER        将此行的注释去掉

# exec /etc/X11/xinit/xinitrc        将此行的注释去掉

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources

         ……….

         ………..

4. 启动对应的VNCSERVER,使用以下命令:

         Vncserver :1  --启动端口号为5901vncserver

         Vncserver :2    --启动端口号为5902vncserver

5. 关闭对应的VNCSERVER,使用以下命令:

  Vncserver –kill :1  --关闭端口号为5901vncserver

  Vncserver –kill :2  --关闭端口号为5902vncserver

6.修改vncserver的密码:

         Vncpasswd

7.  VNCSERVER修改登录用户的信息

        [root@localhost: ~]#vi /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

# .

 

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

 

# Use "-nohttpd" to prevent web-based VNC clients connecting.

 

# 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="1:root 2:demo"     此处添加用户

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

#vncserver -geometry 800x600      设置vncserver的分辨率
#vncserver -geometry 640x480     
设置vncserver的分辨率

#vncserver -depth 8                  设置vncserver的色深
#vncserver -depth 16               
设置vncserver的色深

8.客户端连接VNC服务器:

a、在linux下,运行vncviewer命令即可,服务器地址的写法形如192.168.3.119:1
b
、在windows下,运行windows版本的vncviewer即可,用法与linux下相近。
c
、用浏览器(平台无关),作为java applet来实现,以形如http://192.168.3.119:5801的方式来启动    vnc 端口从5800 开始依次类推,一般会是58005900

 

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23071790/viewspace-690068/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/23071790/viewspace-690068/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值