서버설정은 크게 6단계로 나뉜다.
1. rpm이나 소스로 vnc를 설치한다.(자세한 내용은 생략)
2. /etc/sysconfig/vncserver의 내용을 수정한다.
# 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"
|
FC6에서는 localhost:0.0 은 gdm에서 사용하고 있으므로, 1번 이후로 설정을 해준다.
예를들어 testuser 라는 아이디로 1번 디스플레이 1024x768 해상도로 접속을 하도록 하려면 아래와 같이 추가를 해준다.
VNCSERVERS="1:testuser"
VNCSERVERARGS[1]="-geometry 1024x768 -nohttpd" |
3. vncpasswd로 사용자 비밀번호를 설정한다. 물론 확인을 위해 두번 입력 해야 한다.
이 부분을 하지 않고 vncserver를 구동시키면, 아무런 에러 없이 FAILED 만 출력된다.
$ vncpasswd
Password:
Verify: |
4. 기본으로 설정되는 윈도우 매니저는 twm으로, gdm에 익숙해진 일반유저로서는 교체해주는 것이 좋다.
위의 설정에 해준 아이디의 홈디렉토리에서 .vnc/ 디렉토리에 xstartup이라는 스크립트를 교체 해준다.
xstatup 파일은 /etc/X11/xinit/xinitrc을 xstartup으로 이름 바꾸어 복사해주면 된다.
원본 xstartup
# more xstartup.bak
#!/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 &
# more xstartup
#!/bin/sh
# Copyright (C) 1999 - 2005 Red Hat, Inc. All rights reserved. This
# copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the
# GNU General Public License version 2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Authors:
# Mike A. Harris <mharris@redhat.com>
# Mandatorily source xinitrc-common, which is common code shared between the
# Xsession and xinitrc scripts which has been factored out to avoid duplication
. /etc/X11/xinit/xinitrc-common
# The user may have their own clients they want to run. If they don't,
# fall back to system defaults.
if [ -f $HOME/.Xclients ]; then
exec $SSH_AGENT $DBUS_LAUNCH $HOME/.Xclients || \
exec $SSH_AGENT $HOME/.Xclients
elif [ -f /etc/X11/xinit/Xclients ]; then
exec $SSH_AGENT $DBUS_LAUNCH /etc/X11/xinit/Xclients || \
exec $SSH_AGENT /etc/X11/xinit/Xclients
else
# Failsafe settings. Although we should never get here
# (we provide fallbacks in Xclients as well) it can't hurt.
[ -x /usr/bin/xsetroot ] && /usr/bin/xsetroot -solid '#222E45'
[ -x /usr/bin/xclock ] && /usr/bin/xclock -geometry 100x100-5+5 &
[ -x /usr/bin/xterm ] && xterm -geometry 80x50-50+150 &
[ -x /usr/bin/twm ] && /usr/bin/twm
fi
|
5. 방화벽을 해제하거나, 포트를 풀어준다.(자세한 내용은 생략)
포트는 5900번이 기본으로 디스플레이 포트를 더해준다.
예를들어 3번 display 번호를 사용하면 5900 + 3 = 5903 번의 포트를 열어주어야 한다.
6. vnc 서버를 구동한다.(자세한 내용은 생략)
service vncserver start
service vncserver restart
댓글을 달아 주세요