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
6. VNC Server 시작
# service vncserver start
7. 서버 부팅시 자동 실행 service로 등록
# chkconfig vncserver on
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. 접속화면
++ xhost 문제가 나온다면
[root@CJDP_DB jdk1.6.0_13]# DISPLAY=localhost:2.0
[root@CJDP_DB jdk1.6.0_13]# export DISPLAY
[root@CJDP_DB jdk1.6.0_13]# xhost +
'리눅스 문서' 카테고리의 다른 글
Trac 설치 및 설정 메뉴얼 (0) | 2014.11.25 |
---|---|
리눅스 특정 날짜 이후 변경 파일 찾기 (0) | 2014.11.25 |
Trac & Subversion 백업 및 복구 (0) | 2014.11.25 |
HP ProLiant 서버에 RAID 1으로 Ubuntu 10.4 LTS , HP Sotware 설치 후 RAID 상태 정보 확인 (0) | 2014.11.25 |
HP서버 하드디스크의 상태보기 (0) | 2014.11.25 |