1993.1.22

SUBJECT: Anonymous ftpÀÇ Setup(Solaris 1.x)

CONTENTS:
0. Anonymous ftp¶õ ?
1. Anonymous ftpÀÇ µ¿ÀÛ °úÁ¤
2. Anonymous ftpÀÇ Setup
3. ftp·Î ftp server¸¦ accessÇÏ´Â º¸±â

DESCRIPTION:

0. Anonymous ftp¶õ ?
   * anonymous ftp´Â ftp protocolÀÇ serverÃø Áï "ftpd"°¡ ¼öÇàÇÏ´Â ¿©·¯ service ÁßÀÇ ÇÑ ÇüÅÂÀÌ´Ù.
   * ¾î´À ÇÑ ½Ã½ºÅÛ¿¡ ÀÚ·áµéÀ» ¸ð¾Æ ³õ°í ÇÊ¿äÇÑ »ç¶÷µéÀº °¡Á®°¥ ¼ö ÀÖµµ·Ï Çϸ鼭 
     ¶ÇÇÑ ½Ã½ºÅÛÃø¿¡¼± ÀÚ·á°¡ ÇÊ¿äÇÑ »ç¶÷µéÀÌ ´©±¸ÀÎÁö ¾Ë ÇÊ¿äµµ ¾ø°í
     µû¶ó¼­ ±×µé °³º° »ç¿ëÀÚ¸¦ À§ÇÑ user account¸¦ ¸¸µé ÇÊ¿ä°¡ ¾ø°í
     ÀڷḦ ¸ð¾Æ ³õÀº °÷ ÀÌ¿ÜÀÇ filesystemÀ» ÀüÇô accessÇÏÁö ¸øÇÏ°Ô ÇÏ·Á´Â °æ¿ì
     ÀÌ anonymous ftp´Â À¯¿ëÇÏ´Ù.
   * ÀÚ·á°¡ ÇÊ¿äÇÑ »ç¶÷Àº "ftp"·Î user name "ftp" or "anonymous"·Î loginÇÏ¿© 
     ÇÊ¿äÇÑ ÀڷḦ ftp·Î °¡Á®°¡¸é µÈ´Ù. 

1. Anonymous ftpÀÇ µ¿ÀÛ °úÁ¤
   * ftp¸¦ serviceÇØÁÖ´Â serverÃø ftpd´Â 
     clientÂÊ ftp°¡ usernameÀ» "ftp" or "anonymous"·Î ÁÖ°í µé¾î¿À·Á´Â °æ¿ì
     ÀÚ½ÅÀÇ /etc/passwd file¿¡  username "ftp"("anonymous"°¡ ¾Æ´Ô)°¡ ÀÖ´ÂÁö¸¦ È®ÀÎÇÑ´Ù.
   * È®ÀÎÇÏ¿© ÀÖÀ¸¸é, ¾î¶² password·Îµµ login °¡´ÉÇÏ´Ù. ¸¦ Ãĵµ ÁÁ´Ù.
     ÀüÅëÀûÀ¸·Î´Â clientÂÊÀÇ hostname(username@hostname)À» password·Î ÁÖ°í µé¾î °¬¾ú´Ù.
   * loginÀ» Çϸ鼭 ftpd´Â "chroot(2)" commannd¸¦ »ç¿ëÇÏ¿©
     /etc/passwd¿¡ Á¤ÀÇÇÑ "ftp" accountÀÇ home directory¸¦ 'ftp root directory'·Î ÀνĽÃÄÑ ÁØ´Ù.

2. Anonymous ftpÀÇ Setup
   1) inetd.conf¿¡¼­ ftpd°¡ »ç¿ëµÉ ¼ö ÀÖµµ·Ï µÇ¾î ÀÖ´ÂÁö È®ÀÎ.
   2) /etc/passwd file¿¡ "ftp"¶ó´Â account µî·Ï.
      uid´Â ÀÏ¹Ý user id·Î Àû´çÇÑ °Í ÇÒ´çÇÏ¸é µÊ.
   3) "ftp" home directoryÀÇ setup
     - ~ftp : username "ftp"°¡ owner°¡ µÇ°í ´Ù¸¥ userµéÀÌ writeÇÒ ¼ö ¾øµµ·Ï ¸¸µç´Ù.
     - ~ftp/bin : superuser°¡ owner°¡ µÇµµ·Ï ¸¸µç´Ù.
                  /bin/ls¸¦ copyÇØ´Ù permission mode¸¦ 111·Î ¸¸µç´Ù.
     - ~ftp/usr/lib/ld.so : runtime loaderÀÎ /usr/lib/ld.so¸¦ copyÇØ ³õ´Â´Ù.
     - ~ftp/dev/zero : runtime loader¿¡ ÀÇÇØ »ç¿ëµÇ´Â °ÍÀ¸·Î "mknod zero c 3 12" command·Î ¸¸µç´Ù.
     - ~ftp/usr/lib/libc.so.* : shared C libraryÀÇ latest versionÀ» copyÇÑ´Ù.
     - ~ftp/usr/lib/libdl.so.*
     - ~ftp/etc : superuser°¡ owner°¡ µÇµµ·Ï ¸¸µé°í ´Ù¸¥ user°¡ write ¸øÇϵµ·Ï ¸¸µç´Ù.
                  /etc/passwd, /etc/group fileÀ» copyÇØ ³õ¾Æ¾ß "ls" ¼öÇà½Ã Á¤»óÀû °á°ú¸¦ º¼ °ÍÀÌ´Ù.
                  ÀÌ fileµéÀÇ mode´Â 444°¡ µÇ¾î¾ß ÇÑ´Ù.
     - ~ftp/pub : owner´Â "ftp", mode 777·Î ¸¸µç´Ù.
                  anonymous account·Î µé¾î¿Í º¸°Å³ª °¡Á®°¥ fileµéÀ» ¿©±â¿¡ °¡Á®´Ù ³õ´Â´Ù.

3. ftp·Î ftp server¸¦ accessÇÏ´Â º¸±â

   ¢º sparc# ftp atom
      Connected to atom.
      220 atom FTP server (SunOS 4.1) ready.
      Name (atom:root): ¢Ñ¨ç anonymous
      331 Guest login ok, send ident as password.
   ¢º Password: ¢Ñ¨è
      230 Guest login ok, access restrictions apply.
   ¢º ftp> pwd
      257 "/" is current directory.
   ¢º ftp> ls -l
      200 PORT command successful.
      150 ASCII data connection for /bin/ls (192.9.10.101,1235) (0 bytes).
      total 5
      drwxr-xr-x  2 root          512 Jan 22 07:04 bin
      drwxr-xr-x  2 root          512 Jan 22 07:07 dev
      drwxr-xr-x  2 root          512 Jan 22 07:14 etc
      drwxrwxrwx  2 ftp           512 Jan 24 03:39 pub
      drwxr-xr-x  3 root          512 Jan 22 07:06 usr
      226 ASCII Transfer complete.
      remote: -l
      259 bytes received in 0.16 seconds (1.6 Kbytes/s)
   ¢¹ ftp> ls -lR bin
      200 PORT command successful.
      150 ASCII data connection for /bin/ls (192.9.10.101,1236) (0 bytes).
      bin: Is a directory
      426 Transfer aborted. Data connection closed.
      226 Abort successful
   ¢º ftp> cd bin
      250 CWD command successful.
   ¢º ftp> ls -l
      200 PORT command successful.
      150 ASCII data connection for /bin/ls (192.9.10.101,1237) (0 bytes).
      total 15
      ---x--x--x  1 root        15144 Jan 22 07:04 ls
      226 ASCII Transfer complete.
      remote: -l
      59 bytes received in 0.13 seconds (0.46 Kbytes/s)
   ¢º ftp> cd ../dev
      250 CWD command successful.
   ¢º ftp> ls -l
      200 PORT command successful.
      150 ASCII data connection for /bin/ls (192.9.10.101,1238) (0 bytes).
      total 0
      crw-r--r--  1 root       3,  12 Jan 22 07:07 zero
      226 ASCII Transfer complete.
      remote: -l
      60 bytes received in 0.061 seconds (0.96 Kbytes/s)
   ¢º ftp> cd ../etc
      250 CWD command successful.
   ¢º ftp> ls -l
      200 PORT command successful.
      150 ASCII data connection for /bin/ls (192.9.10.101,1239) (0 bytes).
      total 3
      -r--r--r--  1 root          155 Jan 22 07:14 group
      -r--r--r--  1 root         1032 Jan 22 07:14 passwd
      226 ASCII Transfer complete.
      remote: -l
      114 bytes received in 0.066 seconds (1.7 Kbytes/s)
   ¢º ftp> cd ../usr/lib
      250 CWD command successful.
   ¢º ftp> ls -l
      200 PORT command successful.
      150 ASCII data connection for /bin/ls (192.9.10.101,1240) (0 bytes).
      total 592
      -r-xr-xr-x  1 root        40960 Jan 22 07:06 ld.so
      -rwxr-xr-x  1 root       532480 Jan 22 07:08 libc.so.101.7
      -rwxr-xr-x  1 root        24576 Jan 22 07:12 libdl.so.1.0
      226 ASCII Transfer complete.
      remote: -l
      182 bytes received in 0.096 seconds (1.8 Kbytes/s)
   ¢º ftp> ls -l
      200 PORT command successful.
      150 ASCII data connection for /bin/ls (192.9.10.101,1241) (0 bytes).
      total 592
      -r-xr-xr-x  1 root        40960 Jan 22 07:06 ld.so
      -rwxr-xr-x  1 root       532480 Jan 22 07:08 libc.so.101.7
      -rwxr-xr-x  1 root        24576 Jan 22 07:12 libdl.so.1.0
      226 ASCII Transfer complete.
      remote: -l
      182 bytes received in 0.077 seconds (2.3 Kbytes/s)
   ¢º ftp> cd ../../pub
      250 CWD command successful.
   ¢º ftp> ls -l
      200 PORT command successful.
      150 ASCII data connection for /bin/ls (192.9.10.101,1242) (0 bytes).
      total 1
      -rw-r--r--  1 root          549 Jan 22 07:41 datafile
      226 ASCII Transfer complete.
      remote: -l
      64 bytes received in 0.086 seconds (0.72 Kbytes/s)
      ftp>
   ¢¹ ftp> get /pub/datafile /tmp
      200 PORT command successful.
      150 ASCII data connection for /pub/datafile (192.9.10.101,1243) (549 bytes).
      /tmp: Is a directory
      426 Transfer aborted. Data connection closed.
      226 Abort successful
   ¢º ftp> get /pub/datafile /tmp/datafile
      200 PORT command successful.
      150 ASCII data connection for /pub/datafile (192.9.10.101,1244) (549 bytes).
      226 ASCII Transfer complete.
      local: /tmp/datafile remote: /pub/datafile
      569 bytes received in 0.01 seconds (53 Kbytes/s)
   ¢º ftp> quit
      221 Goodbye.
   ¢º sparc# ls -l /tmp/datafile
      -rw-r--r--  1 root          549 Jan 24 12:50 /tmp/datafile
      sparc#
   

   "¢º" Ç¥½Ã´Â ftp mode¿¡¼­ command¸¦ ½ÇÇàÇÑ lineÀ» º¸¿©ÁØ´Ù.
   "¢¹" Ç¥½Ã´Â ftp mode¿¡¼­ Àß ¸ø ½ÇÇàµÈ lineÀ» °¡¸®Å²´Ù.

   ¢Ñ¨ç
     - login account¸¦ ³Ö¾î ÁÖ´Â °÷.
     - "anonymous"µµ ÁÁ°í "ftp"¿©µµ ÁÁ´Ù. 
   ¢Ñ¨è
     - password¸¦ ³Ö´Â °÷.
     - ¹«¾ùÀ̾ ÁÁ´Ù. ´ÜÁö ¸¸ Ãĵµ ÁÁ´Ù.
       



Revision History
Created        on Jan. 22 ,1993