강좌 & 팁
글 수 2,412
2009.05.28 20:16:29 (*.55.127.122)
282261
tftp는 우분투에서 시냅스 꾸러미 관리자를 이용하는 것 보다는 apt-get install을 직접 사용하는 것이 편하더군요.
~$ sudo apt-get install xinetd tftp tftpd
설치 후에는 tftp를 사용하기 위한 /etc/xinetd.d/tftp 파일을 생성합니다.
~$ sudo vi /etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
tftp에서 파일을 제공할 때 사용하는 디렉토리를 생성합니다.
~$ sudo mkdir /tftpboot ~$ sudo chmod 777 /tftpboot
이제 tftp 서버 실행을 위한 준비는 모두 끝났습니다. 서버를 다시 실행하고 테스트해 보겟습니다.
~$ sudo /etc/init.d/xinetd restart
/tftpboot에 파일을 만들고 다른 디렉토리로 이동하여 파일을 받아 보겠습니다.
~$cd /tftpboot
~$ vi test.txt
아무런 문자열을 입력하고 저장한 후, VI 에디터를 종료합니다.
~$ cd /tmp // 임시 디렉토리로 이동
~$ tftp localhost // tftp 서버와 연결
tftp> get test.txt // test.txt 다운로드
Received 6 bytes in 0.0 seconds
tftp> quit
~$ ls -al // 다운 받은 파일 확인
합계 76
drwxrwxrwt 14 root root 4096 2009-05-25 13:35 .
drwxr-xr-x 22 root root 4096 2009-05-25 13:30 ..
drwxrwxrwt 2 root root 4096 2009-05-25 13:26 .ICE-unix
-r--r--r-- 1 root root 11 2009-05-25 13:22 .X0-lock
drwxrwxrwt 2 root root 4096 2009-05-25 13:22 .X11-unix
drwx------ 2 jwjw jwjw 4096 2009-05-25 13:26 .esd-1000
drwx------ 2 jwjw jwjw 4096 2009-05-25 13:27 ssh-CxzfZm6269
-rw-r--r-- 1 jwjw jwjw 5 2009-05-25 13:35 test.txt
-rw------- 1 root root 0 2009-05-25 13:22 tmp.btyMJW5940
~$ cat test.txt // 내용 출력
tftp로 전송할 파일
~$
이렇게 파일을 수신이 되면 정상적으로 tftp 서버가 설치된 것입니다.


