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

来源:互联网 发布:淘宝商城的企业资质 编辑:程序博客网 时间:2024/05/02 01:54

 怎样运用VNCwindows上管理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,如下图

第六步成功管理.

原创粉丝点击