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 [b]/export/home[/b]
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值