CentOS 5.5 ¿¡´Â ±âº»ÀûÀ¸·Î VNC Server°¡ ¼³Ä¡µÇ¾î ÀÖ¾î ȯ°æ¼³Á¤°ú ¼ºñ½º µî·Ï¸¸À¸·Î VNC¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù.
1. ȯ°æ
- CentOS 5.5 : ¼³Ä¡µÊ
- VNC Viewer : http://www.uvnc.com/download/ ¿¡¼ ´Ù¿î·Îµå
2. ¼³Á¤
# vi /etc/sysconfig/vncservers
3. 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="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 12800x800"
4. VNC ¾ÏÈ£ ¼³Á¤
# vncpasswd
Password:
Verify:
5. Port È®ÀÎ ¹× ¹æȺ® ¿ÀÇÂ
# netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:5801 0.0.0.0:* LISTEN 25974/Xvnc
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 25974/Xvnc
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 2629/portmap
tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN 25974/Xvnc
# vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT (Ãß°¡)
5-1. iptable restart
# /etc/rc.d/init.d/iptables restart
6. VNC Server ½ÃÀÛ
# service vncserver start
7. ¼¹ö ºÎÆýà ÀÚµ¿ ½ÇÇà service·Î µî·Ï
8. À©µµ¿ì¿¡¼ ±×·¡Çȸðµå·Î º¸±â À§ÇÑ ¼³Á¤
# vi /root/.vnc/xstartup
#!/bin/sh
wing 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 &
# 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 &
9. VNC Viewer·Î Á¢¼Ó È®ÀÎ
10. Á¢¼Óȸé
11. Âü°í
http://jonnychoe.egloos.com/5472045