VNC을 이용한 리눅스서버 원격제어

리눅스에서도 윈도우처럼 x-window을 원격제어 할 수 있다.

물론 여러가지 프로그램들이 있지만, 우선 여기에서 VNC를 이용하여 원격제어를

하고자 한다.


1. VNC SERVER가 설치가 되어있는지 확인을 해본다.

 

#rpm -qa|grep vnc
vnc-server-4.1.2-9.el5


2.  VNC가 설치가 되어 있다면 VNC 설정파일에서 사용자를 추가해준다.

#vi /etc/sysconfig/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="1:user"             #이부분의 주석을 제고하고 사용하고자하는 사용자를 등록한다. 사용자앞은 숫자는 접속할때 필요한 것이므로 유의하여 등록한다.
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"


3. VNC를 실행을 위한 준비작업.

  - 환경설정

#vncserver:1
Starting VNC server: 1:user
New 'linux.user:1(user)' desktop is linux.user:1

starting applications specified in /home/user/.vnc/xstartup
Log file is /home/user/.vnc/linux.user:1.log


위 명령을 실행하면 x-windows를 선택할 수 있는 필요 파일들이 생성된다.

#vi ~/.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 &


   - VNC 실행

실행된 VNC 서버가 있다면 설정을 변경한후 재기동을 해준다. 이때 재기동을 해주어야 변경된 환경설정되로 변경된다.

#vncserver -kill:1             
Killing Xvnc process ID 1234

#vncserver:1
Starting VNC server: 1:user
New 'linux.user:1 (user)' desktop is linux.user:1

starting applications specified in /home/user/.vnc/xstartup
Log file is /home/user/.vnc/linux.user:1.log

이제 모든작업을 완료하였다.


그럼 이제 클라이언트에서 접근해보자.





이 글과 관련있는 글을 자동검색한 결과입니다 [?]

by 밀리 | 2008/09/25 12:59 | Linux - Ubuntu | 트랙백 | 덧글(1)

트랙백 주소 : http://ggwangs.egloos.com/tb/870506
☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]
Commented by 정상호 at 2008/11/10 11:30
개인 공부용으로 참조하겠습니다.

:         :

:

비공개 덧글

◀ 이전 페이지          다음 페이지 ▶