104的小美工作家-找工作也可以試試喔!

2009年4月6日 星期一

CentOS5 中VNC Server 設定

1. 所需套件:
# yum -y install vnc vnc-server

2. VNC Server 設定
修改VNCSERVERS="1:myusername" VNCSERVERARGS 的設定
(1表示port為5901,2表示port為5902......; myusername 為登入者帳號)

# vi /etc/sysconfig/vncservers
VNCSERVERS="2:root"
VNCSERVERARGS[2]="-geometry 1024x768 -depth 24"

3. 設定VNC 使用者密碼
# vncpasswd

4. 修改 X桌面設定值,將xstartup中底下的兩行註解拿掉
#service vncserver start (先啟動一次VNC Server)
# vi ~/.vnc/xstartup

unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

5. 設定防火牆,讓VNC Server 可以從外部網路連入
#vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT

6.從新啟動iptables
#service iptables restart

7. 啟動VNC Server 檢查port 有否開啟
# /etc/rc.d/init.d/vncserver start
#netstat -tlnp
tcp 0 0 *:5902

8. 利用VNC Viewer 連入

沒有留言: