<-
Apache > HTTP Server > Documentation > Version 2.2 > Programs

Please note

This document refers to a legacy release (2.2) of Apache httpd. The active release (2.4) is documented here. If you have not already upgraded, please follow this link for more information.

You may follow this link to go to the current version of this document.

htpasswd - basic authentication¿¡ »ç¿ëÇÒ »ç¿ëÀÚÆÄÀÏÀ» °ü¸®ÇÑ´Ù

°¡´ÉÇÑ ¾ð¾î:  en  |  ko  |  tr 

ÀÌ ¹®¼­´Â ÃÖ½ÅÆÇ ¹ø¿ªÀÌ ¾Æ´Õ´Ï´Ù. ÃÖ±Ù¿¡ º¯°æµÈ ³»¿ëÀº ¿µ¾î ¹®¼­¸¦ Âü°íÇϼ¼¿ä.

htpasswd´Â HTTP basic authentication¿¡ »ç¿ëÇÒ »ç¿ëÀÚ¸í°ú ¾ÏÈ£¸¦ ÀúÀåÇÏ´Â ÀϹÝÆÄÀÏÀ» »ý¼ºÇÏ°í ¼öÁ¤ÇÑ´Ù. htpasswd°¡ ÆÄÀÏÀ» ¾²°Å³ª ÀÐÀ» ¼ö ¾ø´Ù¸é, ¿À·ù»óŸ¦ ¹ÝȯÇÏ°í ¾Æ¹«°Íµµ ¼öÁ¤ÇÏÁö ¾Ê´Â´Ù.

¾ÆÆÄÄ¡ À¥¼­¹ö´Â ÀÚ¿øÀ» htpasswd·Î ¸¸µç ÆÄÀÏ¿¡ ±â·ÏÇÑ »ç¿ëÀÚ¿¡°Ô¸¸ º¸¿©ÁÙ ¼ö ÀÖ´Ù. ÀÌ ÇÁ·Î±×·¥Àº »ç¿ëÀÚ¸í°ú ¾ÏÈ£¸¦ ÀúÀåÇÏ´Â ÀÏ¹Ý ÆÄÀÏÀ» °ü¸®ÇÑ´Ù. ±×·¯³ª ´Ù¸¥ ÀÚ·áÀúÀå ¹æ½ÄÀ» À§ÇØ ¾ÏÈ£ Á¤º¸¸¦ ¾ÏȣȭÇÏ¿© ÀúÀåÇÒ ¼ö ÀÖ´Ù. DBM µ¥ÀÌÅͺ£À̽º¸¦ »ç¿ëÇÏ·Á¸é dbmmanage¸¦ Âü°íÇ϶ó.

htpasswd´Â ¾ÆÆÄÄ¡ ƯÀ¯ÀÇ MD5 ȤÀº ½Ã½ºÅÛÀÇ crypt()¸¦ »ç¿ëÇÏ¿© ¾ÏÈ£¸¦ ¾ÏȣȭÇÑ´Ù. htpasswd°¡ °ü¸®ÇÏ´Â ÆÄÀÏÀº µÎ Á¾·ùÀÇ ¾ÏÈ£¸¦ ¸ðµÎ ÀúÀåÇÒ ¼ö ÀÖ´Ù. Áï, °°Àº ÆÄÀÏ¿¡ MD5·Î ¾ÏȣȭÇÑ ¾ÏÈ£¸¦ »ç¿ëÇÏ´Â »ç¿ëÀÚ¿Í crypt()·Î ¾ÏȣȭÇÑ ¾ÏÈ£¸¦ »ç¿ëÇÏ´Â »ç¿ëÀÚ Á¤º¸ ¸ðµÎ ³ª¿Ã ¼ö ÀÖ´Ù.

ÀÌ manpage´Â ¸í·ÉÇà ¿É¼Ç¸¸À» ¼³¸íÇÑ´Ù. httpd¿¡¼­ »ç¿ëÀÚÀÎÁõÀ» ¼³Á¤ÇÏ´Â Áö½Ã¾î¿¡ ´ëÇÑ ¼³¸íÀº ¾ÆÆÄÄ¡ ¹èÆ÷º»¿¡ Æ÷ÇÔµÇÀÖ°í http://httpd.apache.org/¿¡¼­µµ º¼ ¼ö ÀÖ´Â ¾ÆÆÄÄ¡ ¼³¸í¼­¸¦ Âü°íÇ϶ó.

Âü°í

top

°³¿ä

htpasswd [ -c ] [ -m ] [ -D ] passwdfile username

htpasswd -b [ -c ] [ -m | -d | -p | -s ] [ -D ] passwdfile username password

htpasswd -n [ -m | -d | -s | -p ] username

htpasswd -nb [ -m | -d | -s | -p ] username password

top

¿É¼Ç

-b
¹èÄ¡(batch) ¸ðµå¸¦ »ç¿ëÇÑ´Ù. ¿¹¸¦ µé¾î, ¾ÏÈ£¸¦ ¹°¾îº¸Áö¾Ê°í ¸í·ÉÇà¿¡¼­ ¹Þ´Â´Ù. ¸í·ÉÇà¿¡ ¾ÏÈ£°¡ Á÷Á¢ µå·¯³ª¹Ç·Î, ÀÌ ¿É¼ÇÀº ¸Å¿ì Á¶½ÉÇؼ­ »ç¿ëÇØ¾ß ÇÑ´Ù.
-c
passwdfileÀ» ¸¸µç´Ù. passwdfileÀÌ ÀÌ¹Ì Á¸ÀçÇÑ´Ù¸é, µ¤¾î¾´´Ù. ÀÌ ¿É¼ÇÀ» -n ¿É¼Ç°ú °°ÀÌ »ç¿ëÇÒ ¼ö ¾ø´Ù.
-n
ÆÄÀÏÀ» ¼öÁ¤ÇÏÁö¾Ê°í °á°ú¸¦ Ç¥ÁØÃâ·ÂÀ¸·Î Ãâ·ÂÇÑ´Ù. ¾ÆÆÄÄ¡°¡ ¹®¼­ÀÌ¿ÜÀÇ °÷¿¡ »ý¼ºÇÑ ¾ÏÈ£¸¦ ÀúÀåÇÒ¶§ À¯¿ëÇÏ´Ù. (Ç×»ó ù¹ø° ¾Æ±Ô¸ÕÆ®ÀÎ) passwdfile ¾Æ±Ô¸ÕÆ®°¡ ¾ø±â¶§¹®¿¡ ¸í·ÉÇà ¹®¹ýÀÌ ´Ù¸£´Ù. -c ¿É¼Ç°ú °°ÀÌ »ç¿ëÇÒ ¼ö ¾ø´Ù.
-m
MD5¸¦ »ç¿ëÇÏ¿© ¾ÏÈ£¸¦ ¾ÏȣȭÇÑ´Ù. Windows, Netware, TPF¿¡¼­ ±âº»°ªÀÌ´Ù.
-d
crypt()¸¦ »ç¿ëÇÏ¿© ¾ÏÈ£¸¦ ¾ÏȣȭÇÑ´Ù. Windows, Netware, TPF¸¦ Á¦¿ÜÇÑ ¸ðµç Ç÷¡Æû¿¡¼­ ±âº»°ªÀÌ´Ù. ¸ðµç Ç÷¡ÆûÀÇ htpasswd°¡ ÀÌ Çü½ÄÀ» Áö¿øÇÒ ¼ö´Â ÀÖÁö¸¸, Windows, Netware, TPFÀÇ httpd ¼­¹ö´Â ÀÌ Çü½ÄÀ» Áö¿øÇÏÁö ¾Ê´Â´Ù.
-s
¾ÏÈ£¸¦ SHA ¾ÏȣȭÇÑ´Ù. LDAP µð·ºÅ丮±³È¯Çü½Ä(ldif)À» »ç¿ëÇÏ¿© Netscape ¼­¹ö·Î Á¤º¸¸¦ º¸³»°Å³ª °ÅÁ®¿Ã¶§ À¯¿ëÇÏ´Ù.
-p
¾ÏÈ£¸¦ ±×´ë·Î »ç¿ëÇÑ´Ù. ¸ðµç Ç÷¡ÆûÀÇ htpasswd°¡ Áö¿øÇÏÁö¸¸, Windows, Netware, TPFÀÇ httpd µ¥¸ó¸¸ÀÌ ÀÏ¹Ý ¾ÏÈ£¸¦ ¹Þ´Â´Ù.
-D
»ç¿ëÀÚ¸¦ »èÁ¦ÇÑ´Ù. htpasswd ÆÄÀÏ¿¡ »ç¿ëÀÚ¸íÀÌ ÀÖ´Ù¸é »èÁ¦ÇÑ´Ù.
passwdfile
»ç¿ëÀÚ¸í°ú ¾ÏÈ£¸¦ ÀúÀåÇÏ´Â ÆÄÀϸí. -c¸¦ »ç¿ëÇÑ °æ¿ì ÆÄÀÏÀÌ ¾ø´Ù¸é »õ·Î ¸¸µé°í, ÀÖ´Ù¸é µ¤¾î¾´´Ù.
username
passwdfile¿¡ ¸¸µé°Å³ª ¼öÁ¤ÇÒ »ç¿ëÀÚ¸í. usernameÀÌ ÀÌ ÆÄÀÏ¿¡ ¾ø´Ù¸é Ç׸ñÀ» Ãß°¡ÇÑ´Ù. ÀÖ´Ù¸é ¾ÏÈ£¸¦ ¼öÁ¤ÇÑ´Ù.
password
¾ÏȣȭÇÏ¿© ÆÄÀÏ¿¡ ÀúÀåÇÒ ¾ÏÈ£. ¿ÀÁ÷ -b ¿É¼Ç°ú °°ÀÌ »ç¿ëÇÒ ¼ö ÀÖ´Ù.
top

Á¾·áÄÚµå

htpasswd´Â passwdfile¿¡ »ç¿ëÀÚ¸í°ú ¾ÏÈ£¸¦ ¼º°øÀûÀ¸·Î Ãß°¡Çϰųª ¼öÁ¤ÇÑ °æ¿ì ("Âü") Á¾·áÄÚµå 0À» ¹ÝȯÇÑ´Ù. htpasswd´Â ÆÄÀÏ¿¡ Á¢±ÙÇÒ¶§ ¹®Á¦°¡ ¹ß»ýÇÑ °æ¿ì 1À», ¸í·ÉÇà Çü½ÄÀÌ À߸øµÈ °æ¿ì 2¸¦, ÀÔ·ÂÇÑ ¾ÏÈ£¿Í È®ÀÎÂ÷ ´Ù½Ã ÀÔ·ÂÇÑ °ªÀÌ ÀÏÄ¡ÇÏÁö ¾ÊÀº °æ¿ì 3À», ¸í·ÉÀÌ Áß´ÜµÈ °æ¿ì 4¸¦, (»ç¿ëÀÚ¸í, ÆÄÀϸí, ¾ÏÈ£, ÃÖÁ¾ °è»ê°á°ú) °ªÀÌ ³Ê¹« ±ä °æ¿ì 5¸¦, »ç¿ëÀÚ¸í¿¡ Çã¿ëÇÏÁö¾Ê´Â ¹®ÀÚ°¡ Æ÷ÇÔµÈ °æ¿ì Á¦ÇÑ Àý Âü°í) 6¸¦, ÆÄÀÏÀÌ ¿Ã¹Ù¸¥ ¾ÏÈ£ÆÄÀÏÀÌ ¾Æ´Ñ °æ¿ì 7À» ¹ÝȯÇÑ´Ù.

top

¿¹Á¦

htpasswd /usr/local/etc/apache/.htpasswd-users jsmith

»ç¿ëÀÚ jsmithÀÇ ¾ÏÈ£¸¦ Ãß°¡Çϰųª ¼öÁ¤ÇÑ´Ù. »ç¿ëÀÚ¿¡°Ô ¾ÏÈ£¸¦ ¹°¾îº»´Ù. Windows ½Ã½ºÅÛ¿¡¼­ ½ÇÇàÇÏ¸é ¾ÏÈ£¸¦ ¾ÆÆÄÄ¡ ƯÀ¯ÀÇ MD5 ¾Ë°í¸®ÁòÀ» »ç¿ëÇÏ¿© ¾ÏȣȭÇÏ°í, ¾Æ´Ï¸é ½Ã½ºÅÛÀÇ crypt() ÇÔ¼ö¸¦ »ç¿ëÇÑ´Ù. ÆÄÀÏÀÌ ¾ø´Ù¸é htpasswd´Â ¾Æ¹« Àϵµ ÇÏÁö¾Ê°í ¿À·ù¸¦ ³½´Ù.

htpasswd -c /home/doe/public_html/.htpasswd jane

»õ·Î ÆÄÀÏÀ» ¸¸µé°í ±× ÆÄÀÏ¿¡ »ç¿ëÀÚ janeÀ» Ãß°¡ÇÑ´Ù. »ç¿ëÀÚ¿¡°Ô ¾ÏÈ£¸¦ ¹°¾îº»´Ù. ÆÄÀÏÀÌ ÀÖÁö¸¸ Àаųª ¾µ ¼ö ¾ø´Ù¸é, htpasswd´Â ÆÄÀÏÀ» ¼öÁ¤ÇÏÁö¾Ê°í ¹®±¸¸¦ Ãâ·ÂÇÑÈÄ ¿À·ù»óŸ¦ ¹ÝȯÇÑ´Ù.

htpasswd -mb /usr/web/.htpasswd-all jones Pwd4Steve

¸í·ÉÇàÀÇ ¾ÏÈ£(Pwd4Steve)¸¦ MD5 ¾Ë°í¸®ÁòÀ¸·Î ¾ÏȣȭÇÏ¿© ÁöÁ¤ÇÑ ÆÄÀÏ¿¡ ÀúÀåÇÑ´Ù.

top

º¸¾È»ó °í·ÁÇÒ Á¡

htpasswd µîÀÌ °ü¸®ÇÏ´Â À¥ ¾ÏÈ£ÆÄÀÏÀÌ À¥¼­¹öÀÇ URI °ø°£¿¡ ÀÖÀ¸¸é ¾ÈµÈ´Ù. Áï, ºê¶ó¿ìÀú°¡ ÀÌ ÆÄÀÏÀ» º¼ ¼ö ¾ø¾î¾ß ÇÑ´Ù.

¸í·ÉÇà¿¡ ¾ÏȣȭÇÏÁö¾ÊÀº ¾ÏÈ£¸¦ »ç¿ëÇϱ⶧¹®¿¡ -b ¿É¼ÇÀ» ÃßõÇÏÁö ¾Ê´Â´Ù.

top

Á¦ÇÑ

Windows¿Í MPE Ç÷¡ÆûÀº htpasswd°¡ ¾ÏȣȭÇÏ´Â ¾ÏÈ£ÀÇ ±æÀ̸¦ 255 ¹®ÀÚ·Î Á¦ÇÑÇÑ´Ù. ´õ ±ä ¾ÏÈ£´Â 255ÀÚ¿¡¼­ ©¸°´Ù.

htpasswd°¡ »ç¿ëÇÏ´Â MD5 ¾Ë°í¸®ÁòÀº ¾ÆÆÄÄ¡ ¼ÒÇÁÆ®¿þ¾î ƯÀ¯ÀÇ °ÍÀÌ´Ù. À̸¦ »ç¿ëÇÏ¿© ¾ÏȣȭÇÑ ¾ÏÈ£¸¦ ´Ù¸¥ À¥¼­¹ö¿¡¼­ »ç¿ëÇÒ ¼ö ¾ø´Ù.

»ç¿ëÀÚ¸íÀº 255 ¹ÙÀÌÆ®·Î Á¦Çѵǰí : ¹®ÀÚ¸¦ Æ÷ÇÔÇÒ ¼ö ¾ø´Ù.

°¡´ÉÇÑ ¾ð¾î:  en  |  ko  |  tr 

top

Comments

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.