linux远程桌面管理VNC

author:skate

time:2010-05-24


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

以前也用过linux的远程图形界面管理程序x-win32,地址如下:

http://blog.csdn.net/wyzxg/archive/2007/09/10/1779148.aspx 

今天介绍在介绍一个图形管理软件vnc,简单配置如下

vnc服务端os版本:centos4.7
vnc client: nvc viewer客户端


1.检查vnc服务器是否安装


[root@ticket-A ~]# rpm -qa | grep vnc
vnc-server-4.0-12.el4

centos4.7默认已经安装了vnc服务端

如果发现没有安装的话,可以用如下的命令安装

[root@ticket-A ~]# yum -y install vnc vnc-server

2.将用于vnc的用户名添加到配置文件中,这里的用户名是linux系统的用户名

[root@ticket-A ~]# vi /etc/sysconfig/vncservers

# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the line below to start a VNC server on display :1
# 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
# <URL:http://www.uk.research.att.com/vnc/sshvnc.html>.

# VNCSERVERS="1:myusername"
# VNCSERVERARGS[1]="-geometry 800x600"

#skate add

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

~
"/etc/sysconfig/vncservers" 18L, 567C written


注:有的系统配置里有 –nolisten tcp 和 –nohttpd ,这两个是阻止Xwindows登陆
和HTTP方式VNC登陆的,如果需要图形界面,那就删除这部分。

3. 设置用户vnc登录的密码

例如,我这里用root登录,那就在root的环境下执行如下命令,如果是其他用户名
就su - 到其他用户环境下

[root@ticket-A ~]# vncpasswd
Password:
Verify:

4. 启动vnc服务

[root@ticket-A ~]# service vncserver status
Xvnc 已停

[root@ticket-A ~]# service vncserver start
启动 VNC 服务器:1:root [  确定  ]


5. 配置vnc启动时的环境


[root@ticket-A ~]# vi .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
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

#skate add
gnome-session &
#startkde &
~
~

~
~
".vnc/xstartup" 16L, 375C written


6. 再次重启vnc服务,让其修改生效


[root@ticket-A ~]# service vncserver restart
关闭 VNC 服务器:1:root [  确定  ]
启动 VNC 服务器:1:root [  确定  ]
[root@ticket-A ~]#


7.从vnc view登录服务端
在windows上安装vnc view,然后输入ip地址:192.168.2.22:1 连接登录,输入密码即可

备注:VNC给浏览器的端口是5800+N,给vncviewer的端口是5900+N,
N是设置的display号.防火墙一定要打开vnc的设置,VNCViewer 切换全屏模式:F8

---end---

 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/wyzxg/archive/2010/05/24/5620364.aspx

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值