2012年12月13日 星期四

Redhat 5 vncserver 與 vncviewer 的設定步驟


Redhat 5 vncserver vncviewer 的設定步驟



Step1 : 確認系統是否有安裝 vncserver透過 rpm –qa vnc 的指令來確認是否有安裝 vncserver

# rpm -qa | grep vnc
vnc-server-4.0-11.el4
vnc-4.0-11.el4


Step2 : VNC Server 的設定配置
1)      第一次啟動vncserver 會提示輸入密碼:
甲、Root


# vncserver
You will require a password to access your desktops.
Password:    輸入vnc 連接密碼
Verify:     
確認vnc密碼
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



乙、Non-root account
$ vncserver
You will require a password to access your desktops.
Password:     
輸入vnc 連接密碼
Verify:       
確認vnc密碼
xauth:  creating new authority file /home/huilin/.Xauthority
New 'localhost.localdomain:2 (huilin)' desktop is localhost.localdomain:2
Creating default startup script /home/huilin/.vnc/xstartup
Starting applications specified in /home/huilin/.vnc/xstartup
Log file is /home/huilin/.vnc/localhost.localdomain:2.log



2)      配置vnc的配置檔xstartup
# 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
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session gnome   
添加連接時使用 gnome 桌面環境
twm &



3)      vncserver設置登錄用戶的資訊
#vi /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 2:demo"   
此處添加用戶
VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"

#vncserver -geometry 800x600     
設置vncserver的解析度
#vncserver -geometry 640x480     
設置vncserver的解析度
#vncserver -depth 8                 
設置vncserver的色深
#vncserver -depth 16             
設置vncserver的色深



4)      用戶端的連接
a、在linux下,運行vncviewer命令即可,伺服器位址的寫法形如192.168.3.119:1
b
、在windows下,運行windows版本的vncviewer即可,用法與linux下相近。

c、用流覽器(平臺無關),作為java applet來實現,以形如http://192.168.3.119:5801的方式來啟動    vnc 埠從5800 開始依次類推,一般會是58005900

5)      修改密碼
運行vncpasswd即可

6)      停止vncserver

#vncserver -kill :1
#vncserver -kill :2


注意到vncserver只能由啟動它的用戶來關閉,即時是root也不能關閉其他用戶開啟的vncserver
除非用kill命令暴力殺死進程。

7)      穩定性設置
vncserver
默認在多個客戶機連接同一個vncserver的顯示埠時,vncserver埠舊連接,而為新連接服務,可通過-dontdisconnect拒絕新連接請求而保持舊的連接。

8)      同一個顯示器可以連接多個客戶機
#vncserver –alwaysshared



























NetBackup維護指令

NetBackup維護指令

雖然Netbackup是一套圖形化操作界面的備份軟體,但一些磁帶的維護管理,仍需使用指令方式來維護,例如設定過期、凍結的解除、容量等等。



磁帶立即宣告過期。
連到Backup Server,打開命令列,輸入下面指令。
C:\Veritas\NetBackup\bin\Admincmd\bpexpdate.exe -m <media id> -d 0

例如:把184AGX的磁帶設為過期
bpexpdate -m 184AGX -d 0


把backup image宣告過期               
連到Backup Server,打開命令列,輸入下面指令。
C:\Veritas\NetBackup\bin\Admincmd\bpexpdate.exe -backupid <backup id> -d 0

例如:把EDAWSVRDC01_1328724000的backup設為過期

bpexpdate -backupid EDAWSVRDC01_1328724000 -d 0

Are you SURE you want to delete EDAWSVRDC01_1328724000 y/n (n)? y

輸入y,按Enter即可。


查詢Oracle備份紀錄

C:\Veritas\NetBackup\bin\bplist -l -B -C edawsvrdbTP -t 4 -R / 


以下是列出6/30/2012一整天間的kl instance備份
Bplist –B –C edawsvrdbkl –t 4 –s -s 2012-06-30 00:00:00 -e 2012-06-30 23:59:59 -R /


Error 96可能是磁帶被凍結

檢查磁帶狀況
C:\veritas\netbackup\bin\goodies\available_media.cmd
ACTIVE     可用
FULL       滿了
FORZEN     被凍結使用



解除凍結
C:\Veritas\NetBackup\bin\Admincmd\bpmedia -unfreeze -m <media id>

Disable ESX啟動 ssh後的警告

Disable ESX啟動 ssh後的警告

通常為了管理需要,會把ESX的ssh服務打開,以便使用pietty連線管理。但一旦啟動ssh,在vSphere Client就會在,host的圖示及Summary,看到啟動ssh的警告,而且就算重新開機,都不會消失!實在是非常的討厭 >"<



取消警告的方法如下:
用vSphere Client連接ESX,點Configuration ->Advanced Settings -> UserVars -> 捲軸拉到最下,找到UserVars.SuppressShellWarning -> 將原本的0改為1,再按OK即可。




警告已消失