VNCServer 配置總結


VNCServer 配置 
1、vncserver服務的啓動redhat一般都自動安裝了vncserver了 只要在服務列表中選中啓動一下就可以了) 
  命令:
Java代碼  收藏代碼
  1. service vncserver start/restart/stop  

  啓動桌面:vncserver(第一次啓動時需要設置密碼) 

2、vncserver的桌面配置 
  通過編輯文件$HOME/.vnc/xstartup來啓動你喜歡的窗口管理器。 
  使用startkde &來啓動KDE,使用gnome-session &來啓動GNOME,fvwm2 &來啓動FVWM2。 
例如: 
##################################################### 
#!/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 
#startkde 
#twm & 
########################################################## 

3、關閉服務器上自己的vnc連接 
  
Java代碼  收藏代碼
  1. vncserver -kill  :桌面號  

如:vncserver -kill  :1 

4、修改密碼 
--刪除密碼文件 
rm -f $HOME/.vnc/passwd 
--重新啓動vncserver,根據提示輸入新的密碼即可 
vncserver 

5、如何使服務器開機自動運行vncserver 不需要自己telnet 
   設置vncserver啓動腳本實現系統自啓動時啓動vncserver。 
編輯/etc/sysconfig/vncservers,例如: 
Java代碼  收藏代碼
  1. # The VNCSERVERS variable is a list of  
  2. # display:user pairs.  
  3. #  
  4. # Uncomment the line below to start a VNC server on  
  5. # display :1 as my 'myusername' (adjust this to your  
  6. # own). You will also need to set a VNC password;  
  7. # run 'man vncpasswd' to see how to do that.  
  8. #  
  9. # DO NOT RUN THIS SERVICE if your local area network  
  10. # is untrusted! For a secure way of using VNC, see  
  11. # <URL:http://www.uk.research.att.com/vnc/sshvnc.html>.  
  12.   
  13. VNCSERVERS="2:oracle"  
  14. #VNCSERVERARGS[2]="-geometry 800*600 -nolisten tcp -nohttpd -localhost"  


在VNCSERVERS中修改myusername爲你希望運行VNC桌面的用戶。VNCSERVERS中的1表示VNC以桌面1運行,如果希望添加其他的桌面,可以修改配置如下: 
Java代碼  收藏代碼
  1. VNCSERVERS="1:root 2:oracle".  


VNCSERVERARGS可以設定對具體桌面連接的限定,具體參數說見文件開頭說明,一般註釋掉即可。 

6、防火牆會阻止vnc服務 
防火牆關閉和開啓的命令:service iptables stop/start(及時生效) 
或編輯/etc/sysconfig/iptables 

7、如果想要刪除當前配置的vnc,直接刪除當前用戶下的.vnc 目錄即可 
例如: 
Java代碼  收藏代碼
  1. # cd /home/oracle  
  2. # rm -rf .vnc  




在Solaris下 
Java代碼  收藏代碼
  1. # vncserver  
  2. vncserver: couldn't find "Xvnc" on your PATH.  

執行如下即可 
Java代碼  收藏代碼
  1. #su root  
  2. #  
  3. # ln -s /usr/openwin/bin/xauth /usr/bin/  
  4. # ln -s /usr/X11/bin/Xvnc /usr/bin/  


另外說明下在Solaries下的vnc配置和linux的一樣,區別在於useradd用戶後 
Java代碼  收藏代碼
  1. root用戶  
  2. su -  
  3. # groupadd dba  
  4. # groupadd oinstall  
  5. # useradd -g oinstall -G dba -m -d /export/home/oracle -s /usr/bin/bash oracle  
  6. # passwd oracle  


用戶所在目錄有變化: 
/home is an auto mount directory. The home directory for user in Solaris should be created in /export/home
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章