Chinaunix首页 | 论坛 | 博客
  • 博客访问: 866966
  • 博文数量: 69
  • 博客积分: 10434
  • 博客等级: 上将
  • 技术积分: 1941
  • 用 户 组: 普通用户
  • 注册时间: 2005-05-28 16:10
文章存档

2012年(1)

2009年(14)

2008年(54)

分类: LINUX

2008-03-19 20:22:00

/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="2:myusername"

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

 

###############################配置后的###############################

# 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="2:root"  ##这里可以添加多个用户;

VNCSERVERARGS[2]="-geometry 800x600"   ##这里注意一下,默认系统配置里有 –nolisten tcp –nohttpd ,这两个是阻止Xwindows登陆和HTTP方式VNC登陆的,如果需要图形界面,那就删除这部分。) 1表示VNC以桌面1运行,这样可以启动root的桌面。

/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" &

twm &

 

###############################配置后的###############################

#!/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 &     #set starting GNOME desktop

#startkde &         #kde desktop

#twm &            #Text interface

 

设置用户marsaber的密码

[marsaber@centos ~]$ vncpasswd

Password:

Verify:

 

netstat -nlp    ##查看监听的端口;

chkconfig --level 345 vncserver on    #345状态下启动ncserver服务;

service vncserver start|stop|restart    #启动、关闭、重启vncserver服务;

 

控制:

 

Windows平台下的VNC Viewer

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