Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1660695
  • 博文数量: 391
  • 博客积分: 8464
  • 博客等级: 中将
  • 技术积分: 4589
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-13 15:12
个人简介

狮子的雄心,骆驼的耐力,孩子的执著!

文章分类

全部博文(391)

文章存档

2023年(4)

2018年(9)

2017年(13)

2016年(18)

2014年(7)

2013年(29)

2012年(61)

2011年(49)

2010年(84)

2009年(95)

2008年(22)

分类: 系统运维

2008-12-13 19:05:08

Linux VNC Server

1.vncserver #初始化用户vnc配置,密码

[root ~]vncserver

passwd: //如果这个帐号是第一次运行vncserver,则会要求你输入连接的密码。

verify:

New 'server1.linux:1 (root' desktop is server1.linux:1

Starting applications specified in /root/.vnc/xstartup

2. ~/.vnc/xstartup #用户登陆环境设置,如下设置

[root ~] more /root/.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" &

#传统界面,很烂

gnome-session & #gnome桌面环境

#twm &

3. /etc/sysconfig/vncservers #系统VNCSERVER设置

[root@centos1 ~]# more /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"

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

4.service vncserver #重新启动服务

service vncserver restart

5.vnc viewer

Download VNC Free Edition 4.1

打开 vnc viewer,在[server ] 172.16.103.24:1 #连接指定地址的1号通道

注意,系统需要安装gonme的Xwindow软件,同时iptables要开放5801,5901,6001等三个端口。

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name

tcp 0 0 0.0.0.0:5801 0.0.0.0:* LISTEN 4201/Xvnc

tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 4201/Xvnc

tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN 4201/Xvnc

阅读(1194) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~