`
xw302
  • 浏览: 120672 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

VNCServer 配置总结

阅读更多
VNCServer 配置
1、vncserver服务的启动redhat一般都自动安装了vncserver了 只要在服务列表中选中启动一下就可以了)
  命令:
service vncserver start/restart/stop

  启动桌面:vncserver(第一次启动时需要设置密码)

2、vncserver的桌面配置
  通过编辑文件$HOME/.vnc/xstartup来启动你喜欢的窗口管理器。
  使用startkde &来启动KDE,使用gnome-session &来启动GNOME,fvwm2 &来启动FVWM2。
例如:
#####################################################
#!/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
#startkde
#twm &
##########################################################

3、关闭服务器上自己的vnc连接
  
 vncserver -kill  :桌面号

如:vncserver -kill  :1

4、修改密码
--删除密码文件
rm -f $HOME/.vnc/passwd
--重新启动vncserver,根据提示输入新的密码即可
vncserver

5、如何使服务器开机自动运行vncserver 不需要自己telnet
   设置vncserver启动脚本实现系统自启动时启动vncserver。
编辑/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="2:oracle"
#VNCSERVERARGS[2]="-geometry 800*600 -nolisten tcp -nohttpd -localhost"


在VNCSERVERS中修改myusername为你希望运行VNC桌面的用户。VNCSERVERS中的1表示VNC以桌面1运行,如果希望添加其他的桌面,可以修改配置如下:
VNCSERVERS="1:root 2:oracle".


VNCSERVERARGS可以设定对具体桌面连接的限定,具体参数说见文件开头说明,一般注释掉即可。

6、防火墙会阻止vnc服务
防火墙关闭和开启的命令:service iptables stop/start(及时生效)
或编辑/etc/sysconfig/iptables

7、如果想要删除当前配置的vnc,直接删除当前用户下的.vnc 目录即可
例如:
# cd /home/oracle
# rm -rf .vnc




在Solaris下
# vncserver
vncserver: couldn't find "Xvnc" on your PATH.

执行如下即可
#su root
#
# ln -s /usr/openwin/bin/xauth /usr/bin/
# ln -s /usr/X11/bin/Xvnc /usr/bin/


另外说明下在Solaries下的vnc配置和linux的一样,区别在于useradd用户后
root用户
su -
# groupadd dba
# groupadd oinstall
# useradd -g oinstall -G dba -m -d /export/home/oracle -s /usr/bin/bash oracle
# passwd oracle


用户所在目录有变化:
/home is an auto mount directory. The home directory for user in Solaris should be created in /export/home


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics