ÀÌÀüÆäÀÌÁö ´ÙÀ½ÆäÀÌÁö Â÷·Ê

6. patchÇϰųª upgradeÇÒ ÇÊ¿ä°¡ ÀÖ´Â ´Ù¸¥ programµé

password·Î Á¢±ÙÀ» ÇÊ¿ä·Î ÇÏ´Â ´ëºÎºÐ programµéÀÇ ´ëÄ¡Ç°ÀÌ shadow suite¿¡ Æ÷ÇԵǾî ÀÖ´Ù°í Çصµ, ´ëºÎºÐ system¿¡¼­ password Á¢±ÙÀ» ÇÊ¿ä·Î ÇÏ´Â ´Ù¸¥ programµéÀÌ ÀÖ´Ù.

Debian ¹èÆ÷ÆÇÀ» ¾²°í ÀÖ´Ù¸é (¶Ç´Â ¾²°í ÀÖÁö ¾Ê´õ¶óµµ), ftp://ftp.debian.org/debian/stable/source/·ÎºÎÅÍ ´Ù½Ã ¸¸µé¾î¾ß µÉ programµéÀÇ Debian source¸¦ ¾òÀ» ¼ö ÀÖ´Ù.

ÀÌ sectionÀÇ ³ª¸ÓÁö ºÎºÐÀº adduser, wu_ftpd, ftpd, pop3d, xlock, xdm, sudo°°Àº programµéÀÌ shadow suite¸¦ Áö¿øÇϵµ·Ï upgradeÇÏ´Â ¹ý¿¡ ´ëÇØ ´Ù·ç°í ÀÖ´Ù.

shadow suite¿¡ ´ëÇÑ Áö¿øÀ» ¾î¶»°Ô program¿¡ ³Ö´Â°¡ÇÏ´Â ¹®Á¦´Â section C program¿¡ Shadow¸¦ Áö¿øÇϵµ·Ï µ¡ºÙÀ̱⸦ º¸¶ó (±×¸®°í³ª¼­ programÀÌ shadow fileÀ» Á¢±ÙÇÒ ¼ö ÀÖµµ·Ï SUID root³ª SGID shadow·Î ½ÇÇàÇØ¾ß µÇÁö¸¸)

6.1 Slackware adduser program

Slackware ¹èÆ÷ÆÇ( ´Ù¸¥ °ÍµéÁß¿¡¼­µµ)Àº /sbin/adduser¶ó°í ºÒ¸®¿ì´Â »ç¿ëÀÚ¸¦ Ãß°¡ÇÒ ¶§ ¾²´Â ´ëÈ­½Ä programÀ» Æ÷ÇÔÇÏ°í ÀÖ´Ù. ÀÌ programÀÇ shadow versionÀº ftp://sunsite.unc.edu/pub/Linux/system/Admin/accounts/adduser.shadow-1.4.tar.gz¿¡¼­ ±¸ÇÒ ¼ö ÀÖ´Ù.

³ª´Â slackwareÀÇ adduser´ë½Å¿¡ Shadow Suite¿¡ ÀÖ´Â programµé (useradd, usermod, userdel)À» »ç¿ëÇÒ °ÍÀ» ±ÇÇÑ´Ù. ±×µéÀ» ÀÍÈ÷´Â µ¥ ´Ù¼Ò ½Ã°£ÀÌ °É¸®Áö¸¸, ±×¸¸ÇÑ °ª¾îÄ¡¸¦ ÇÑ´Ù. ¿Ö³ÄÇÏ¸é ´ç½ÅÀº Á»´õ ÀÚ¼¼È÷ controlÇÒ ¼ö ÀÖ°í, /etc/passwd¿Í /etc/shadow¿¡ ¾Ë¸ÂÀº file lockingÀ» ÇàÇØÁֱ⠶§¹®ÀÌ´Ù (adduser´Â ¾Æ´Ï´Ù).

Á¾ ´õ ÀÚ¼¼ÇÑ °É ¾Ë°í ½ÍÀ¸¸é Shadow Suite »ç¿ëÇϱ⸦ ÂüÁ¶Çϵµ·Ï.

ÇÏÁö¸¸, °¡Áö°í ÀÖ´Ù¸é ´ÙÀ½Ã³·³ Çضó:

tar -xzvf adduser.shadow-1.4.tar.gz
cd adduser
make clean
make adduser
chmod 700 adduser
cp adduser /sbin

6.2 The wu_ftpd Server

´ëºÎºÐ Linux systemÀº wu_ftpd server¸¦ ¾²°í ÀÖ´Ù. ¹èÆ÷ÆÇÀ¸·ÎºÎÅÍ shadow¸¦ ¼³Ä¡ÇÏÁö ¾Ê¾Ò´Ù¸é, ´ç½ÅÀÇ wu_ftpd´Â shadow Áö¿øÀ» Çϵµ·Ï compileµÇÁö ¾Ê¾Ò´Ù. wu_ftpd´Â root process·Î½á ½ÇÇàµÇ´Â inetd/tcpd·ÎºÎÅÍ ½ÃÀ۵ȴÙ. ¾ÆÁ÷µµ ³°Àº wu_ftpd deamonÀ» ¾²°í ÀÖ´Ù¸é, ±× ³ðÀº root °èÁ¤À» À§ÅÂ·Ó°Ô ÇÏ´Â bug¸¦ Áö´Ï°í Àֱ⿡ ¹«Á¶°Ç upgrade¸¦ ÇØ¾ß µÈ´Ù ( Linux security home page¸¦ ÂüÁ¶).

´ÙÇàÈ÷ source code¸¦ °¡Á®¿Í shadow°¡ °¡´ÉÇϵµ·Ï ÀçcompileÇϱ⸸ ÇÏ¸é µÈ´Ù.

¾²°í ÀÖ´Â °ÍÀÌ ELF systemÀÌ ¾Æ´Ï¶ó¸é, wu_ftp server´Â sunsiteÀÇ wu-ftp-2.4-fixed.tar.gz¸¦ ¾²¸é µÈ´Ù.

ÀÏ´Ü °¡Á®¿Í¼­ /usr/src¿¡ ³õÀº µÚ:

cd /usr/src
tar -xzvf wu-ftpd-2.4-fixed.tar.gz
cd wu-ftpd-2.4-fixed
cp ./src/config/config.lnx.shadow ./src/config/config.lnx

±×·±´ÙÀ½ ./src/makefiles/Makefile.lnxÀ» ¼öÁ¤ÇÑ´Ù:

LIBES    = -lbsd -support
¸¦:
LIBES    = -lbsd -support -lshadow
À¸·Î.

ÀÌÁ¦ script¸¦ ¸¸µé°í ¼³Ä¡Çϱâ À§ÇÑ Áغñ°¡ ³¡³µ´Ù:

cd /usr/src/wu-ftpd-2.4-fixed
/usr/src/wu-ftp-2.4.fixed/build lnx
cp /usr/sbin/wu.ftpd /usr/sbin/wu.ftpd.old
cp ./bin/ftpd /usr/sbin/wu.ftpd

ÀÌ´Â Linux shadow ¼³Á¤ fileÀ» »ç¿ëÇؼ­ compileÇÏ°í server¸¦ ¼³Ä¡ÇÑ´Ù.

³» Slackware 2.3 system¿¡¼­´Â build¸¦ ½ÇÇà½ÃÅ°±â Àü¿¡ ´ÙÀ½°ú °°Àº ÀÏÀ» ÇØ¾ß Çß´Ù:

cd /usr/include/netinet
ln -s in_systm.h in_system.h
cd -

ELF system¿¡¼­ ÀÌ package¸¦ compileÇÏ´Â µ¥ ¸î°¡Áö ¹®Á¦Á¡µéÀÌ º¸°í µÇ¾úÁö¸¸, ´ÙÀ½ releaseÀÇ Beta version¿¡¼­´Â Àß µÈ´Ù. ±×°ÍÀº wu-ftp-2.4.2-beta-10.tar.gzÀÌ´Ù.

ÀÏ´Ü °¡Á®¿Í¼­ /usr/src¿¡ ³õÀº µÚ:

cd /usr/src
tar -xzvf wu-ftpd-2.4.2-beta-9.tar.gz
cd wu-ftpd-beta-9
cd ./src/config

±×·± µÚ config.lnx¸¦ ¼öÁ¤ÇÑ´Ù:

#undef SHADOW.PASSWORD
À»:
#define SHADOW.PASSWORD
À¸·Î. ±×¸®°í
cd ../Makefiles
Makefile.lnx¸¦ ¼öÁ¤ÇÑ´Ù:
LIBES = -lsupport -lbsd # -lshadow
¸¦:
LIBES = -lsupport -lbsd -lshadow
À¸·Î. ¸¶Áö¸·À¸·Î ¸¸µé°í ¼³Ä¡:
cd ..
build lnx
cp /usr/sbin/wu.ftpd /usr/sbin/wu.ftpd.old
cp ./bin/ftpd /usr/sbin/wu.ftpd

´ç½ÅÀÇ wu.ftpd server°¡ ½ÇÁ¦·Î ¾îµð ÀÖ´Â Áö È®ÀÎÇϱâ À§ÇØ /etc/inetd.conf¸¦ Á¡°ËÇØ º¸¶ó. ¾î¶² ¹èÆ÷ÆÇ¿¡¼­´Â server deamonÀ» ´Ù¸¥ Àå¼Ò¿¡ µÎ°í, ƯÈ÷ wu.ftpd´Â ´Ù¸¥ À̸§À» ÇÏ°í ÀÖ´Ù´Â ¸»ÀÌ ÀÖ´Ù.

6.3 Ç¥ÁØ ftpd

Ç¥ÁØ ftpd server¸¦ ¾²°í ÀÖ´Ù¸é wu_ftpd server¸¦ ¾²µµ·Ï ±ÇÇÑ´Ù. À§¿¡¼­ ¾ê±âÇÑ bug¿Ü¿¡´Â ÀϹÝÀûÀ¸·Î ´õ ¾ÈÀüÇÑ °ÍÀ¸·Î ¾Ë·ÁÁ® ÀÖ´Ù.

Ç¥ÁØÀ» °è¼Ó °í¼öÇϰųª NISÀ» Áö¿øÇÒ ÇÊ¿ä°¡ ÀÖ´Ù¸é, Sunsite¿¡ ftpd-shadow-nis.tgz°¡ ÀÖ´Ù.

6.4 pop3d (Post Office Protocol 3)

POP3°¡ ÇÊ¿äÇϸé, pop3d programÀ» ÀçcompileÇØ¾ß ÇÑ´Ù. pop3d´Â root ±ÇÇÑÀ¸·Î inetd/tcpd¿¡ ÀÇÇØ ½ÇÇàµÈ´Ù.

Sunsite¿¡ µÎ°¡Áö versionÀÌ ÀÖ´Ù: pop3d-1.00.4.linux.shadow.tar.gz ¿Í pop3d+shadow+elf.tar.gz

µÑ ´Ù ¼³Ä¡±îÁö ¼ö¿ùÇÏ°Ô ÁøÇàµÈ´Ù.

6.5 xlock

shadow suite¸¦ ¼³Ä¡ÇÏ°í, X Windows System°ú upgradeÇÏÁö ¾Ê°í xlockÀ¸·Î screen¿¡ lockÀ» °Ç´Ù¸é, Ctrl-Atl-Fx¸¦ ´­·¯ ´Ù¸¥ tty·Î loginÇÑ µÚ xlock process¸¦ Á׿© ÇÒ °ÍÀÌ Æ²¸²¾ø´Ù (¶Ç´Â Ctrl-Alt-BS·Î X server¸¦ Á×ÀÌ´ø°¡). ´ÙÇàÈ÷ xlock programÀ» upgradeÇÏ´Â °ÍÀº ½±´Ù.

XFree86 3.x.x¸¦ ¾²°í ÀÖ´Ù¸é, ¾Æ¸¶µµ xlockmore (lock±â´É¿¡ ÈǸ¢ÇÑ screen-saver±îÁö ÀÖ´Â)¸¦ ¾²°í ÀÖÀ» °ÍÀÌ´Ù. ÀÌ package´Â shadow¿Í ÇÔ²² ÀçcompileÇÒ ¼ö ÀÖµµ·Ï µÇ¾î ÀÖ´Ù. ³°Àº xlock¸¦ ¾²°í ÀÖ´Ù¸é, ÀÌ °É·Î upgradeÇϵµ·Ï ±ÇÇÑ´Ù.

xlockmore-3.7.tgz´Â ftp://sunsite.unc.edu/pub/Linux/X11/xutils/screensavers/xlockmore-3.7.tgz ¿¡ ÀÖ´Ù.

´ë°³, ÀÌ°Ô ±¸¹Ì¿¡ µü ¸ÂÀ» °ÍÀÌ´Ù.

xlockmore-3.7.tgzÀ» ±¸ÇÑ ´ÙÀ½, /usr/src¿¡ Ǭ´Ù:

tar -xzvf xlockmore-3.7.tgz

/usr/X11R6/lib/X11/config/linux.cf fileÀÇ ´ÙÀ½ lineÀ» ¹Ù²Ù¸é µÈ´Ù:

#define HasShadowPasswd    NO

¸¦ ´ÙÀ½Ã³·³

#define HasShadowPasswd    YES

±×¸®°í ³ª¼­ ½ÇÇà fileÀ» ¸¸µéÀÚ:

cd /usr/src/xlockmore
xmkmf
make depend
make

¸¶Áö¸·À¸·Î ¸ðµÎ Á¦ÀÚ¸®¿¡, ¹Ù¸¥ permissionÀ» Áö´Ï°Ô ÇÏ¸é ³¡ÀÌ´Ù:

cp xlock /usr/X11R6/bin/
cp XLock /var/X11R6/lib/app-defaults/
chown root.shadow /usr/X11R6/bin/xlock
chmod 2755 /usr/X11R6/bin/xlock
chown root.shadow /etc/shadow
chmod 640 /etc/shadow

ÀÌÁ¦ xlockÀº Àß µ¹¾Æ°¥ °ÍÀÌ´Ù.

6.6 xdm

xdm´Â X-Windows»ó¿¡¼­ÀÇ login screenÀ» º¸¿©ÁØ´Ù. ¾î¶² systemÀº ƯÁ¤ level·Î °¡µµ·Ï ÁöÁ¤Çϸé xdmÀ» ½Ãµ¿½ÃŲ´Ù(/etc/inittab¸¦ º¸µµ·Ï).

Shadow Suite°¡ ¼³Ä¡µÇ¸é xdmµµ updateµÉ ÇÊ¿ä°¡ ÀÖ´Ù. ÀÌ´Â ¸Å¿ì ½±´Ù.

xdm.tar.gz´Â ftp://sunsite.unc.edu/pub/Linux/X11/xutils/xdm.tar.gz¿¡ ÀÖ´Ù.

xdm.tar.gz¸¦ ±¸ÇÑ ´ÙÀ½, /usr/src¿¡¼­ Ǭ´Ù:

tar -xzvf xdm.tar.gz

/usr/X11R6/lib/X11/config/linux.cf¿¡¼­ ´ÙÀ½ lineÀ» °íÄ£´Ù:

#define HasShadowPasswd    NO

¸¦ ´ÙÀ½Ã³·³

#define HasShadowPasswd    YES

±×¸®°í ³ª¼­ ½ÇÇà fileÀ» ¸¸µéÀÚ:

cd /usr/src/xdm
xmkmf
make depend
make

¸ðµç °É Á¦ÀÚ¸®·Î...:

cp xdm /usr/X11R6/bin/

xdmÀº root ±ÇÇÑÀ¸·Î ½ÇÇàµÇ±â¿¡ permissionÀ» ¹Ù²Ü ÇÊ¿ä´Â ¾ø´Ù.

6.7 sudo

sudo´Â ½Ã½ºÅÛ °ü¸®ÀÚ°¡ »ç¿ëÀÚ·Î ÇÏ¿©±Ý Á¤»óÀûÀ¸·Î root ±ÇÇÑÀ» °¡Áö°í programµéÀ» ½ÇÇàÇÒ ¼ö ÀÖ°Ô Çϵµ·Ï Çã¿ëÇØÁØ´Ù. ÀÌ °ÍÀº drive¸¦ mountÇÏ´Â °Í°ú °°Àº ÀÏÀ» »ç¿ëÀÚ°¡ ÇÒ ¼ö ÀÖµµ·Ï Çã¿ëÇÔÀ¸·Î½á, system °ü¸®ÀÚ°¡ root °èÁ¤À¸·Î Á¢¼ÓÇÒ Çʿ並 ¾ïÁ¦ÇÒ ¼ö ÀÖ´Ù´Â ¸é¿¡¼­ °£ÆíÇÏ´Ù.

sudo´Â ½ÇÇàµÉ ¶§ »ç¿ëÀÚ password¸¦ È®ÀÎÇϱ⠶§¹®¿¡ password¸¦ ÀÐÀ» ÇÊ¿ä°¡ ÀÖ´Ù. sudo´Â ÀÌ¹Ì SUID root»óÅ·Πµ¿À۵DZ⿡ /etc/shadow file¿¡ Á¢±ÙÇÏ´Â µ¥ ¹®Á¦´Â ¾ø´Ù.

shadow suite¿¡ ¸Â´Â sudo´Â ftp://sunsite.unc.edu/pub/Linux/system/Admin/sudo-1.2-shadow.tgz¿¡ ÀÖ´Ù.

°æ°í: sudo¸¦ ¼³Ä¡ÇÒ ¶§, ±âÁ¸ÀÇ /etc/sudoers´Â ±âº» ¼³Á¤À¸·Î ´ëüµÈ´Ù. ±×·¯¹Ç·Î ±âº» ¼³Á¤ÀÌ¿ÜÀÇ °ÍÀ» ¾²°í ÀÖ´Ù¸é backupÀ» Çϱ⠹ٶõ´Ù (¶Ç´Â, Makefile¿¡¼­ ±âº» ¼³Á¤ fileÀ» /etc·Î º¹»çÇϵµ·Ï Áö½ÃÇÏ´Â lineÀ» Á¦°ÅÇÏ¸é µÈ´Ù).

ÀÌ package´Â ÀÌ¹Ì shadow¸¦ ¾µ ¼ö ÀÖ°Ô ¼³Á¤µÇ¾î ÀÖÀ¸¹Ç·Î, ÀçcompileÇϱ⸸ ÇÏ¸é µÈ´Ù (/usr/src¿¡ ³Ö°í):

cd /usr/src
tar -xzvf sudo-1.2-shadow.tgz
cd sudo-1.2-shadow
make all
make install

6.8 imapd (E-Mail pine package)

imapd´Â pop3d¿Í À¯»çÇÑ E-mail serverÀÌ´Ù. imapd´Â Pine E-mail°ú °°ÀÌ ÀÖ´Ù. package¿¡ µé¾î ÀÖ´Â ¹®¼­´Â linux system¿¡¼­ shadow¸¦ Áö¿øÇϵµ·Ï ÇÏ´Â °ÍÀÌ ±âº» ¼³Á¤À̶ó°í Çϳª, »ç½ÇÀÌ ¾Æ´Ñ °ÍÀ¸·Î ³ª´Â ¾Ë°í ÀÖ´Ù. ´õ¿ì±â ÀÌ packageÀÇ build script/Makefile Á¶ÇÕÀº libshadow.alibrary¸¦ compileÇÒ ¶§ µ¡ºÙÀ̱â Èûµé°Ô ÇÑ´Ù. °í·Î ³ª´Â imapd¿¡ shadow¸¦ Áö¿øÇϵµ·Ï °íÄ¥ ¼ö ¾ø¾ú´Ù.

Ȥ½Ã ÀÌ ÀÏÀ» Çس½ »ç¶÷ÀÌ ÀÖÀ¸¸é ³»°Ô E-mailÀ» º¸³»±â ¹Ù¶õ´Ù. ±×·¯¸é ³ª´Â ÀÌ °÷¿¡ ÇØ°á¹ýÀ» Æ÷ÇÔ½ÃÅ°°Ú´Ù.

6.9 pppd (Point-to-Point Protocol Server)

pppd server´Â ¿©·¯°¡Áö ¹æ½ÄÀ¸·Î ÀÎÁõÇÒ ¼ö ÀÖ°Ô ¼³Á¤ÇÒ ¼ö ÀÖ´Ù: Password Authentication Protocol (PAP)¿Í Cryptographic Handshake Authentication Protocol (CHAP). ´ë°³ pppd server´Â /etc/ppp/chap-secrets¿Í/¶Ç´Â /etc/ppp/pap-secrets¿¡ ÀÖ´Â password¸¦ Àд´Ù. ÀÌ·± ½ÄÀ¸·Î pppd¸¦ ¾´´Ù¸é, pppd¸¦ ´Ù½Ã ¼³Ä¡ÇÒ ÇÊ¿ä°¡ ¾ø´Ù. (¿ªÀÚÁÖ: ppp¿ë password¸¦ µû·Î µÐ´Ù´Â ¶æÀÎ µí...)

pppd´Â login parameter¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Ù (command lineÀÌ°Ç, option fileÀ̳ª ¼³Á¤À» ÅëÇؼ­°Ç). login optionÀÌ ÁÖ¾îÁö¸é, pppd´Â PAP¸¦ À§ÇØ /etc/passwd¿¡ ÀÖ´Â username°ú password¸¦ »ç¿ëÇÒ °ÍÀÌ´Ù. ¹°·Ð ÀÌ °æ¿ì¿¡ shadowµÈ password fileÀº ¾µ¸ð¾ø´Ù. pppd-1.2.1d¿¡¼­ shadow¸¦ Áö¿øÇϵµ·Ï code¸¦ µ¡ºÙ¿©¾ß µÈ´Ù.

´ÙÀ½ section¿¡¼­ pppd-1.2.1d¿¡ shadow¸¦ Áö¿øÇϵµ·Ï ÇÏ´Â ¿¹¸¦ º¸ÀÏ °ÍÀÌ´Ù (pppdÀÇ ¿¾ version).

pppd-2.2.0´Â ÀÌ¹Ì shadow°¡ Áö¿øµÈ´Ù.


ÀÌÀüÆäÀÌÁö ´ÙÀ½ÆäÀÌÁö Â÷·Ê