Linux安全网 - Linux操作系统_Linux 命令_Linux教程_Linux黑客

会员投稿 投稿指南 本期推荐: 强烈推荐:Ylmf OS 3.0 正式版发布附迅雷高 XP系统下硬盘安装Fedora 14图文教程
搜索:
您的位置: Linux安全网 > Linux入门 > » 正文

RHL配置VNC Server

来源: gtlions 分享至:
RHL配置VNC Server

0. 启动vncserver服务
[root@linuxso.com ~]# service vncserver status
Xvnc 已停
[root@linuxso.com ~]# service vncserver start
启动 VNC 服务器:no displays configured                    [确定]
1. 开启vncserver服务端
[root@linuxso.com ~]# vncserver :1

You will require a password to access your desktops.

Password:
Verify:

New 'localhost.localdomain:1 (root)' desktop is localhost.localdomain:1

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log
2. 修改vnc显示方式
默认情况下是shell,下面设置使用xwindows方式登录到远程linux,将默认的twm &注释掉,增加一行gnome-session &,使用的是GNOME桌面,还有KED方式:startkde&。
[root@linuxso.com ~]# vi /root/.vnc/xstartup
[root@linuxso.com ~]# cat /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 &
gnome-session &
如果要立即生效连接桌面方式,需要重启服务:
[root@linuxso.com ~]# vncserver -kill :1
Killing Xvnc process ID 8135
[root@linuxso.com ~]# vncserver :1
查看下监听状态:
[root@linuxso.com ~]# netstat -tulnp
3. 在客户端连接
192.168.2.203:5901 http://192.168.2.203:5801
4. 配置vncserver自启动
[root@linuxso.com ~]# chkconfig --list vncserver
vncserver          0:关闭    1:关闭    2:关闭    3:关闭    4:关闭    5:关闭    6:关闭
[root@linuxso.com ~]# chkconfig --level 2345 vncserver on
[root@linuxso.com ~]# chkconfig --list vncserver
vncserver          0:关闭    1:关闭    2:启用    3:启用    4:启用    5:启用    6:关闭
修改开机启动服务进程
[root@linuxso.com ~]# vi /etc/sysconfig/vncservers
[root@linuxso.com ~]# cat /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
# <URL:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.

# 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[1]="-geometry 1024x768"
 
 -The End-

Tags:
分享至:
最新图文资讯
1 2 3 4 5 6
验证码:点击我更换图片 理智评论文明上网,拒绝恶意谩骂 用户名:
关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 发展历史