화일 전송 ftp(File Trasfer Program)은 호스트간의 화일을 전송시키기 위한 프로그램 이다. soback과 ring간에 화일을 전송시키는 방법을 알아보자. 먼저, soback에서 ring으로 ftp를 이용하여 connection을 생성하면 다음과 같이 ftp의 명령모드로 들어간다. +------------------------------------------------------------------------+ | % ftp ring.kotel.co.kr | | Connected to ring.kotel.co.kr. | | 220 ring.kotel.co.kr FTP server (SunOS 4.1) ready | | Name (ring.kotel.co.kr:hsbyun): sonnim | | 331 Password required for sonnim | | Password: | | 230 User sonnim logged in. | | ftp> | +------------------------------------------------------------------------+ 'ftp>' 프롬프트에서 사용자는 다양한 명령어를 입력 할수 있읍니다. 'dir'은 현재 디렉토리에 있는 파일을 보여준다. +------------------------------------------------------------------------+ | ftp> dir | | 200 PORT command successful. | | 150 Opening ASCII mode data connection for /bin/ls. | | total 3116 | | drwxr-xr-x 2 7 21 512 Nov 21 1988 .forward | | -rw-rw-r-- 1 7 11 0 Jun 23 1988 .hushlogin | | drwxrwxr-x 2 0 21 512 Jun 4 1990 Census | | drwxrwxr-x 2 0 120 512 Jan 8 09:36 ClariNet | | -rw-rw-r-- 1 7 14 2018887 May 21 01:01 uumap.tar.Z | | drwxrwxr-x 2 7 6 1024 May 11 10:58 uunet-info | | 226 Transfer complete. | | 5414 bytes receivedin 1.1 seconds (4.9 Kbytes/s) | | ftp> | +------------------------------------------------------------------------+ 이제 ring의 sonnim이라는 ID를 사용하는 사용자의 home directory에 있는 sample 이라는 화일을 soback으로 전송하는 방법을 알아보자. +------------------------------------------------------------------------+ | ftp> cd ~sonnim | | 250 CWD command successful. | | ftp> get sample | | 200 PORT command successful. | | 150 ASCII data connection for sample (147.6.4.65,1034)(742 bytes). | | 226 ASCII transfer complete. | | local: sample remote: sample | | 742 bytes received in 0.01 seconds (75Kbytes/s) | | ftp> | +------------------------------------------------------------------------+ 또한, soback의 화일을 ring으로 전송하는 방법은 다음과 같다. +------------------------------------------------------------------------+ | ftp> put sample | | 200 PORT command successful. | | 150 ASCII data connection for sample (147.6.1.2,1034)(742 bytes). | | 226 ASCII transfer complete. | | local: sample remote: sample | | 742 bytes received in 0.01 seconds (75Kbytes/s) | | ftp> | +------------------------------------------------------------------------+ ftp 프로그램은 동시에 하나 이상의 화일을 전송시킬 수 있다. 예를 들어 다음과 같이 ftp의 명령어 모드에서 mget과 mput 명령어를 사용하여 ".c"로 끝나는 모든 화일을들 전송해 보자. +------------------------------------------------------------------------+ | ftp> mget *.c | | mput samlpe1.c? y | | 200 PORT command successful. | | 150 ASCII data connection for sample1.c (147.6.4.65,1039). | | 226 Transfer complete. | | local: sample1.c remote: sample1.c | | 2327 bytes sent in 0.01 seconds (75Kbytes/s) | | mput sample2.c? y | | 200 PORT command successful. | | 150 ASCII data connection for sample2.c (147.6.4.65,1040). | | 226 Transfer complete. | | local: sample2.c remote: sample2.c | | 2327 bytes sent in 0.01 seconds (75Kbytes/s) | | ftp> | +------------------------------------------------------------------------+ mput과 mget은 화일들을 전송시킬 때 마다 전송여부를 확인하는데 이때 y를 입력하면 전송을하고 y 이외의 다른 문자를 입력하면 전송을 하지 않는다. 그러나 사용자가 무조건 모든 화일을 전송하고 싶으면 prompt 명령을 사용하면 된다. +------------------------------------------------------------------------+ | ftp> prompt off | | Interactive mode off | | ftp> mput *.c | | 200 PORT command successfil. | | 150 ASCII data connection fot sample1.c(143.248.1.2,1042) (713 bytes). | | 226 ASCII Transfer complete. | | local: sample1.c remote: sample1.c | | 734 bytes transfered in 0.01 seconds (72 Kbytes/s) | | 200 PORT command successful. | | 150 ASCII data connection fot sample2.c(143.248.1.2,1042) (713 bytes). | | 226 ASCII Transfer complete. | | local: sample2.c remote: sample2.c | | 734 bytes transfered in 0.01 seconds (72 Kbytes/s) | | 226 ASCII Transfer complete. | | ftp> | +------------------------------------------------------------------------+ 전송하고자 하는 화일의 형태에 따라서 텍스트 화일인 경우 ASCII로 또는 image 화일인 경우에는 binary로 모드를 변경시켜 전송할 수 있다. +------------------------------------------------------------------------+ | ftp> binary | | 200 Type set to I. | | ftp> ascii | | 200 Type set to A. | | ftp> | +------------------------------------------------------------------------+ 그외에 ftp의 명령어 모드에서 수행될 수 있는 명령어들은 다음과 같다. +------------------------------------------------------------------------+ | ftp> help | | Commands may be abbreviated. Commands are: | | | | ! cr ls prompt runique | | $ delee macdef proxy send | | account debug mdelete sendport status | | append dir mdir put struct | | ascii disconnect mget pwd sunique | | bell form mkdir quit tenex | | binary get mls quote trace | | bye glob mode recv type | | case hash mput remotehelp user | | cd help nmap rename verbose | | cdup image ntrans reset ? | | close lcd open rmdir | | ftp>quit | | 221 Goodbye | | % | +------------------------------------------------------------------------+ 호스트간의 화일 전송이 끝나면 quit나 bye 명령을 사용하여 ftp를 종료한다. * Anonymous FTP의 이용 * anonymous ftp란 호스트간에 특별히 사용자 번호를 갖고있지 않아도 유용한 정보 를 전송할 수 있게하는 방법으로 일반 사용자들이 공용으로 사용할 수 있는 사용자 번호인 anonymoys라는 이름으로 ftp를 하면 된다. 이 경우 password로는 일반적으로 사용자의 사용자 번호나 전자메일 주소를 적으면 된다. 국내에서도 몇개의 호스트가 anonymous 서비스를 제공하고 있는데 그 호스트들의 목록은 다음과 같다. han.hana.nm.kr ring.kotel.co.kr garam.kreonet.re.kr ftp.kaist.ac.kr Internet에서 접속할 수 있는 anonymous ftp가 가능한 호스트의 목록을 담고있는 화일은 han.hana.nm.kr에 anonymous ftp로 접속하면 찾을 수 있다. 다음은 soback에서 han.hana.nm.kr에 anonymous ftp를 하여 anon.ftp.list라는 화일을 받아오는 예이다. +------------------------------------------------------------------------+ | Connected to han.hana.nm.kr. | | 220 han.hana.nm.kr FTP server (SunOS 4.1) ready | | Name (ring.kotel.co.kr:hsbyun): anonymous | | 331 Guest login ok, send ident as password. | | Password: | | 230 Guest login ok, access restrictions apply. | | ftp> cd netinfo | | 200 CWD command successful | | ftp> get anon.ftp.list | | 200 PORT command successful. | | 150 ASCII data connection for anon.ftp.list (3024 bytes). | | 226 ASCII transfer complete. | | local: anon.ftp.list remote: anon.ftp.list | | 3024 bytes received in 0.01 seconds (256 Kbytes/s) | | ftp> quit | | 221 Goodbye. | | % | +------------------------------------------------------------------------+ KIDS KIDS KIDS KIDS KIDS ,__o kids는 여러분 모두의 KIDS KIDS KIDS KIDS KIDS ~~~ _-\_<, 광장 입니다. KIDS KIDS KIDS KIDS KIDS ~~~ (*)/'(*) sysop@kids.kotel.co.kr KIDS KIDS KIDS KIDS KIDS -------------------------------------