2010年6月18日 星期五

Config VNC linux

1. Cai dat VNC qua YUM
- yum install vnc-server
2. Config file vncserver
- vi /etc/sysconfig/vncservers
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
Chu y rang : session number cung noi cho chung ta biet cong ma vncserver se lang nghe.
Nho rang Gnome Remote Desktop hoi chung ta de su dung computername:0 nhu mot chuoi ket noi, session number se duoc cong them
5900 de ra cong ma vncserver se lang nghe.
Trong truong hop nay chung ta can su dung cong 5901, nen chung ta dung session 1.
Ban co the su dung bat ky so nao, vi du:
VNCSERVERS="2000:bobpeers"
VNCSERVERARGS[2000]="-geometry 1024x768 -depth 16"
Luc nay thi chung ta phai dung cong 7900
3. Khoi dong vncserver
- vncserver
- change pass
- verify pass
4. Sua file xstartup
- 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 &
5. Restart VNCserver
- vncserver -kill :1
6. Open port tren iptables
- vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
7. Restart iptables
- service iptables restart
8. Khoi dong lai VNCserver
- /etc/init.d/vncserver restart
9. Khoi dong VNC khi bat may
- chkconfig vncserver on

沒有留言:

張貼留言