您的位置:首页 > 运维架构 > Linux

怎样运用VNC在windows上管理Linux的桌面

2009-11-06 10:46 281 查看
怎样运用VNC在windows上管理Linux的桌面

第一步: 在被控端安装VNC

[root@localhost aaa]# rpm -Uvh vnc-4_1_3-x86_linux.rpm
Preparing... ########################################### [100%]
1:vnc ########################################### [100%]
Checking for perl... [OK]
Checking for uname... [OK]
Checking for xauth... [OK]
[root@localhost aaa]#
[root@localhost aaa]#

第二步: 设置VNCserver启动变量:
为了使VNCserver在每次启动时保持不变的端口号(5901)
在/etc/rc.d/rc.local文件中添加命令:
rm -f /tmp/.X11-unix/X*
rm -f /.VNC/*.pid
rm -f /.VNC/*.log
这样,每次启机,系统会先把上次非正常关机时留下的临时文件删除。

第三步: 使VNC viewer通过gonme管理,设置如下:



编辑/$home/.vnc/xstartup文件,把里面所有的行前面都加上#号让他们都失效;
在最后加上一行
gnome-session &

查看/etc/sysconfig/vncservers 可使用-nolisten tcp 拒绝监听 –nohttpd 拒绝浏览器访问 –localhost 拒绝远程访问
# 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 800x600 -nolisten tcp -nohttpd -localhost"

第四步: 启动vncserver服务

进入/usr/bin目录
[root@localhost bin]# vncserver

You will require a password to access your desktops.

Password: 在此输入密码
Verify: 再次确认密码
xauth: creating new authority file /root/.Xauthority

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

第五步: 在windows上启动vnc viewer,如下图





第六步: 成功管理.

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: