配置linux遠端管理 VNC

myownstars發表於2011-04-21

檢查VNC軟體安裝包

[root@rac2 oracle]#  rpm -qa | grep vnc

vnc-4.0-12.el4_7.1

vnc-server-4.0-12.el4_7.1

已經安裝,則開啟VNC服務

[root@rac2 oracle]# /etc/init.d/vncserver start

Starting VNC server: [  OK  ]

執行vncserver且輸入密碼

[root@rac2 oracle]# vncserver

 

You will require a password to access your desktops.

 

Password:

Verify:

 

New 'rac2:1 (root)' desktop is rac2:1

 

Creating default startup script. /root/.vnc/xstartup

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/rac2:1.log

此時在win端開啟vnc viewer, 並輸入linux伺服器地址*.*.*.*:1

要求輸入剛剛的口令

即可看到遠端的Linux視窗,為了視窗看起來更舒服點,可以配置以下檔案

[root@rac2 oracle]# 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 &

[root@rac2 oracle]# vi /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 &

Entering Ex mode.  Type "visual" to go to Normal mode.                                                           

:wq

"~/.vnc/xstartup" 12L, 330C written

[root@rac2 oracle]# vncserver

 

New 'rac2:2 (root)' desktop is rac2:2

 

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/rac2:2.log

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15480802/viewspace-693097/,如需轉載,請註明出處,否則將追究法律責任。

相關文章