BackTrack 5R3 安装VNC
1.安装vnc4server软件包并设置密码
root@bt:~# apt-get install vnc4server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libecryptfs0 libdmraid1.0.0.rc16 libdebconfclient0 ecryptfs-utils cryptsetup rdate bogl-bterm libdebian-installer4
reiserfsprogs dmraid python-pyicu
Use 'apt-get autoremove' to remove them.
Suggested packages:
vnc-java
The following NEW packages will be installed:
vnc4server
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,176kB of archives.
After this operation, 5,571kB of additional disk space will be used.
Get:1 revolution/main vnc4server 4.1.1+xorg4.3.0-37ubuntu2 [2,176kB]
Fetched 2,176kB in 4s (479kB/s)
Selecting previously deselected package vnc4server.
(Reading database ... 264111 files and directories currently installed.)
Unpacking vnc4server (from .../vnc4server_4.1.1+xorg4.3.0-37ubuntu2_amd64.deb) ...
Processing triggers for man-db ...
Setting up vnc4server (4.1.1+xorg4.3.0-37ubuntu2) ...
update-alternatives: using /usr/bin/vnc4server to provide /usr/bin/vncserver (vncserver) in auto mode.
update-alternatives: using /usr/bin/Xvnc4 to provide /usr/bin/Xvnc (Xvnc) in auto mode.
update-alternatives: using /usr/bin/x0vnc4server to provide /usr/bin/x0vncserver (x0vncserver) in auto mode.
update-alternatives: using /usr/bin/vnc4passwd to provide /usr/bin/vncpasswd (vncpasswd) in auto mode.
update-alternatives: using /usr/bin/vnc4config to provide /usr/bin/vncconfig (vncconfig) in auto mode.
root@bt:~# vncserver
You will require a password to access your desktops.
Password:
Verify:
New 'bt:1 (root)' desktop is bt:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/bt:1.log
/-- 此时系统会提示你输入密码,在通过客户端链接时将会用到这个密码。--/
2.编辑 /root/.vnc/xstartup 文件
root@bt:~# cd /root/.vnc
root@bt:~/.vnc# ls
bt:1.log bt:1.pid passwd xstartup
root@bt:~/.vnc# vi 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 注释行
-
#vnccon** -iconic & 注释行
-
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & 注释行
-
#x-window-manager & 注释行
3.
修改/etc/X11/xinit/xinitrc文件的许可,使其可执行
root@bt:~/.vnc# ls -alt /etc/X11/xinit/xinitrc
-rw-r--r-- 1 root root 166 2009-12-07 22:40 /etc/X11/xinit/xinitrc
root@bt:~/.vnc# chmod 755 /etc/X11/xinit/xinitrc
root@bt:~/.vnc# ls -alt /etc/X11/xinit/xinitrc
-rwxr-xr-x 1 root root 166 2009-12-07 22:40 /etc/X11/xinit/xinitrc
(vnc连接灰屏,跟这权限有关,执行之即可)
4.杀掉已经启动vnc4server并重启建立一个vnc4server
root@bt:~/.vnc# vncserver -kill :1
Killing Xvnc4 process ID 2299
root@bt:~/.vnc# vncserver -kill :1
Can't find file /root/.vnc/bt:1.pid
You'll have to kill the Xvnc4 process manually
root@bt:~/.vnc# vncserver
New 'bt:1 (root)' desktop is bt:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/bt:1.log
root@bt:~/.vnc#
5.使用vncviewer.exe客户端软件登陆
阅读(2026) | 评论(0) | 转发(1) |