ÀÌ ¼½¼ÇÀº ´ç½ÅÀÇ »õ·Î¿î µµ¸ÞÀÎÀ» À§ÇÑ º¸¾ÈÀÇ ¼³Á¤À» ¸»ÇÒ °ÍÀÌ´Ù. °Á¶µÉ ºÎºÐÀº ¹Ù·Î À¯Àúµé¿¡°Ô ÀÖ´Ù. ¸¸¾à ´ç½ÅÀÇ º¸¾ÈÀÌ ³Ê¹«³ª °¿äµÇ°í, ÀÎÅÍÆäÀ̽º°¡ À¯Àú¿¡°Ô ³Ê¹« ¾î·Æ°Ô¸¸ µÇ¾î ÀÖ´Ù¸é À¯ÀúµéÀº ¿ÂÀüÇÑ µµ¸ÞÀο¡ ŸÇùÇÏ¿© ÀÚ½ÅÀÇ È¯°æÀ» °³¹ßÇÒ °ÍÀÌ´Ù. ±×·± »çŸ¦ ÇÇÇÒ °¡Àå ÃÖÀûÈµÈ ¹æ¹ýÀº °¡´ÉÇÑÇÑ º¸¾È¿¡ ÀÖ¾î Åõ¸í¼ºÀ» ÁöÇâÇ϶ó´Â °ÍÀÌ´Ù. ±×¸®°í À¯ÀúµéÀÌ ´ç½ÅÀÇ ³×Æ®¿÷¿¡ µé¾î ¿Í¼ »çÀÌÆ®ÀÇ º¸¾È ¹®Á¦·Î ¾î·Á¿òÀ» °ÞÀ» ¶§ ¿ë±â¸¦ ºÏµ¸¾ÆÁÖ¾î¶ó. ¼ÒÀ§ À¯¿¬¼ºÀ̶ó´Â °ÍÀÌ Áß¿äÇÑ °ÍÀÌ´Ù. ³ª´Â º¸¾ÈÀÌ ³Ê¹«³ª ¾ö°ÝÇÏ¿©, À¯ÀúµéÀÌ ±×µéÀÇ ¿ÜºÎ·Î ³ª°¡±â À§ÇÑ ¹æȺ®À» ÅëÇÑ ³×Æ®¿÷ ÅͳÎÀ» ´Ü¼øÇÏ°Ô ¼³Á¤ÇÒ ¼ö ¹Û¿¡ ¾øÀ» ¶§¸¦ ¾Ë°í ÀÖ´Ù. ÀÌ°ÍÀº ¿ø°Ý ·Î±×ÀÎÀ» Çã¿ëÇÏ´Â °Í º¸´Ù´Â ÁÁ´Ù. ȤÀº À¯ÀúµéÀÌ ±×·¸°Ô Çϵµ·Ï ÇÒ ¼öµµ ÀÖ´Ù. ¾î´ÀÂÊÀ» ¼±ÅÃÇÏ°Ç ´ç½ÅÀÇ ÀÚÀ¯´Ù.
ÀÌ ¼½¼ÇÀº ´ç½ÅÀÇ ³×Æ®¿÷ÀÌ ¿ÜºÎ·ÎºÎÅÍ °ø°ÝÀ» ´çÇϰųª, ȤÀº ³»ºÎÀÇ ½ºÇªÇÎÀ» ´çÇÏ´Â °æ¿ì·Î º¸¾ÈÀ» ºÐ·ùÇÑ´Ù. ³»ºÎÀÇ ÇÕ¹ýÀûÀÎ »ç¿ëÀÚÀÇ °ø°ÝÀ» ¸·´Â °ÍÀÌ ´õ¿í ¾î·Æ°í °íµÈ ÀÛ¾÷À» Æ÷ÇÔÇÑ´Ù. ±×¸®°í ±¸Ã¼ÀûÀÎ ³»¿ëÀº ÀÌ ¹®¼¸¦ ³Ñ¾î¼´Â °ÍÀÌ´Ù.
ÀÌ ¼½¼Ç¿¡¼ ¸»ÇÏ·Á´Â º¸¾ÈÀǹ®Á¦´Â ``ÀûÀÇ ÀÖ´Â ¶ó¿ìÅÍ''¿¡ ´ëÀÀÇϱâ À§ÇÑ °ÍÀÌ´Ù. ´ç½ÅÀÇ ISPÀÇ ¶ó¿ìÅÍ °ø±ÞÀÚ´Â ±×°ÍÀ» ¿ø°ÝÀ¸·Î ¼³Á¤, Á¦¾îÇÒ ¼ö ÀÖ´Â °ÍÀÏ °¡´É¼ºÀÌ Å©¹Ç·Î, °ü¸®ÀÚÀÇ Æнº¿öµå¸¦ °ø±ÞÀÚ¿¡°Ô¼ ¾ò¾î ¼³Á¤ÇÑ´Ù. ¿¹Àü¿¡´Â ¶ó¿ìÅÍÀÇ »ý»êÀÚ°¡ ³»ÀåÇÑ Æнº¿öµå(°ü¸®ÀÚ°¡ Æнº¿öµå¸¦ Àؾî¹ö·ÈÀ» ¶§¸¦ ´ëºñÇÑ ÀÀ±Þ¿ë.) °¡ ½Ã½ºÅÛ Å©·¡Ä¿¿¡°Ô ¾Ë·ÁÁ® º¸¾ÈÀÇ ¹®Á¦°¡ »ý°å¾ú´Ù. °¡´ÉÇÒ ¶§ ´ç½ÅÀº ´ç½ÅÀÇ º¸¾È¿¡ ÀÖ¾î ¶ó¿ìÅÍ°¡ ¾î¶² ÀûÀÇ ÀÖ´Â °ø°ÝÀ» ¹ÞÀ½À» °¡Á¤ÇÏ¿© µðÀÚÀÎÇØ¾ß ÇÑ´Ù. ±×°ÍÀº, ´ç½ÅÀÇ °ø½ÄÀûÀÎ, ȤÀº »ç¼³ ³×Æ®¿÷ÀÇ ¾î´À IP¸¦ ÀÌ¿ëÇÏ¿© ´Ù¸¥ »çÀÌÆ®¿¡ ÆÐŶÀ» º¸³¿À¸·Î¼ ´©°¡ ±× ÀÏÀ» Çß´ÂÁö¸¦ ¾Ë ¼ö ¾ø°Ô ÇÏ´Â °ÍÀÌ ÀÖ´Ù.
ÀÌ ¼½¼ÇÀº ipchains ±â¹ÝÀÇ ¸Å½ºÄ¿·¹À̵ù ¼³Á¤°ú, Æ÷¿öµù, ¶ó¿ìÅÍÀÇ ÇÊÅ͸µÀ¸·Î ³ª´«´Ù. ´ç½ÅÀº IPCHAINS-HOWTO ¸¦ ¸ÕÀú Àд °ÍÀÌ ÁÁ´Ù. ±×¶§ ÀÌ°ÍÀ» ÈùÆ®ÀÇ metalab.unc.edu/pub/Linux/docs/HOWTO/IPCHAINS-HOWTO Ãß°¡¸¦ À§ÇØ Àеµ·Ï ÇÏÀÚ. ±× HOWTO´Â ¸Å½ºÄ¿·¹À̵ùÀ» Áö¿øÇÏ´Â Ä¿³ÎÀÇ ÄÄÆÄÀϺÎÅÍ, ÀÌÁø ipchains »ç¿ëÀÇ ¼¼ºÎ »çÇ×±îÁö ´Ù·ç°í ÀÖ´Ù. ´ç½ÅÀº ¿ÜºÎ IP¸¦ °¡Áø ¾î¶² ÄÄÇ»Å͵µ ¹æȺ®À¸·Î¼ ÇÒ ¼öÀÖ´Ù.
»ç¼³ ³×Æ®¿÷ °ÔÀÌÆ®¿þÀÌ ¸Ó½ÅÀ» °¡Á¤ÇÏ°í ´ç½ÅÀÇ ½ºÅ¸Æ®¾÷ ½ºÅ©¸³Æ®¸¦ üũÇ϶ó.:
ipchains ±â¹ÝÀÇ ¹æȺ®¿¡¼ ÀϹÝÀûÀÎ ¹®Á¦´Â ´ç½ÅÀÇ ·ê´ë·Î µµÂøÇÏ´Â ·çÇÁ¹é ÀÎÅÍÆäÀ̽º¿¡¼ÀÇ ÆÐŶµéÀÇ Á¤Á¤¿¡ ´ëÇÑ ±ÇÅ ȤÀº ¿ÜºÎ ȤÀº ³»ºÎ¿¡¼ÀÇ ¹æȺ® µµÂø¿¡ °üÇÑ °ÍÀÌ´Ù. ÀÌ·± Áö¿ªÀûÀÎ ÆÐŶÀº ¹æȺ®¿¡ ÀÇÇØ ºí·ÏȵȴÙ. ¾ÆÁÖ ÀÚÁÖ, ÀÌ·± ÀÛ¾÷Àº ¹æȺ®ÀÇ ¾îÇø®ÄÉÀ̼ÇÀÌ ¹æȺ®ÀÇ È£½ºÆ®¿¡¼ µ¹°í ÀÖ´Â µ¿¾È Áý¾î³»´Â ¼³Á¤¿¡ ÀÇÇØ ¼³Á¤»êźÃÑ µð¹ö±ë½Ä Á¢±Ù¿¡ ÀÇÇÑ ¼ÒÆ®¿¡ ÀÇÇØ ¼ö¸®µÈ´Ù. ºÒ¿îÇÏ°Ôµµ ÀÌ·± °ÍµéÀÇ ¹æȺ®¿¡¼ÀÇ °á°ú´Â Àǹ̾ø¾îÁö´Â ±¸¸ÛÀÌ µÈ´Ù. ipchains¿Í ÇÔ²² ÀÌ·± °ÍÀº ¹æȺ®ÀÇ ½ºÅ©¸³Æ®¸¦ µð¹ö±ëÀÌ ¿ëÀÌÇϵµ·Ï ¾²°í ¸¹Àº ÆÐŶ ¼Ò½º ¹®Á¦¸¦ »ìÆ캸´Â °ÍÀ¸·Î ÇØ°áÇÒ ¼ö ÀÖ´Ù. ÀÌ°ÍÀº /sbin/firewall.sh ½ºÅ©¸³Æ®ÀÇ »ùÇÃÀÌ´Ù.:
#! /bin/sh # # New firewalling script using IP chains. Creates a filtering router # with network masquerading. # # define a few variables IPCHAINS=/sbin/ipchains LOCALNET="192.168.1.0/24" # the private network ETHINSIDE="192.168.1.1" # fred.example.com's private IP # ETHOUTSIDE="10.1.1.9" # fred.example.com's public IP # LOOPBACK="127.0.0.1/8" ANYWHERE="0/0" OUTSIDEIF=eth1 # fred.example.com's private interface FORWARD_PROCENTRY=/proc/sys/net/ipv4/ip_forward # # These two commands will return error codes if the rules # already exist (which happens if you run the firewall # script more than once). We put the commands before "set -e" # so that the script doesn't abort in that case. $IPCHAINS -N outside $IPCHAINS -N portmap set -e # Abort immediately on error setting # up the rules. # # Turn off forwarding and clear the tables echo "0" > ${FORWARD_PROCENTRY} $IPCHAINS -F forward $IPCHAINS -F input $IPCHAINS -F output $IPCHAINS -F outside $IPCHAINS -F portmap # # Masquerade packets from within our local network destined for the # outside world. Don't masquerade packets which are local to local $IPCHAINS -A forward -s $LOCALNET -d $LOCALNET -j ACCEPT $IPCHAINS -A forward -s $ETHOUTSIDE -d $ANYWHERE -j ACCEPT $IPCHAINS -A forward -s $LOCALNET -d $ANYWHERE -j MASQ # # Set the priority flags. Minimum delay connections for www, telnet, # ftp, and ssh (outgoing packets only). $IPCHAINS -A output -p tcp -d $ANYWHERE www -t 0x01 0x10 $IPCHAINS -A output -p tcp -d $ANYWHERE telnet -t 0x01 0x10 $IPCHAINS -A output -p tcp -d $ANYWHERE ftp -t 0x01 0x10 $IPCHAINS -A output -p tcp -d $ANYWHERE ssh -t 0x01 0x10 # # Anything from our local class C is to be accepted, as are # packets from the loopback and fred's external IP. $IPCHAINS -A input -s $LOCALNET -j ACCEPT $IPCHAINS -A input -s $LOOPBACK -j ACCEPT $IPCHAINS -A input -s $ETHOUTSIDE -j ACCEPT # We'll create a set of rules for packets coming from the big, bad # outside world, and then bind all external interfaces to it. This # rule will be called "outside" # # We also create a "portmap" chain. The sockets used by daemons # registered with the RPC portmapper are not fixed, and so it is # a bit difficult to set up filter rules for them. The portmap # chain is configured in a separate script. # # Send packets from any outside interface to the "outside" # rules chain. This includes the $OUTSIDEIF interface and any # ppp interfaces we create for dialout (or dialin). $IPCHAINS -A input -i ${OUTSIDEIF} -j outside $IPCHAINS -A input -i ppp+ -j outside ################################################## # # Set up the "outside" rules chain # # ################################################## # # Nobody from the outside should claim to be coming from our localnet # or loopback $IPCHAINS -A outside -s $LOCALNET -j DENY $IPCHAINS -A outside -s $LOOPBACK -j DENY # # No packets routed to our local net should come in from outside # because the outside isn't supposed to know about our private # IP numbers. $IPCHAINS -A outside -d $LOCALNET -j DENY # # Block incoming connections on the X port. Block 6000 to 6010. $IPCHAINS -l -A outside -p TCP -s $ANYWHERE -d $ANYWHERE 6000:6010 -j DENY # # Block NFS ports 111 and 2049 $IPCHAINS -l -A outside -p TCP -s $ANYWHERE -d $ANYWHERE 111 -j DENY $IPCHAINS -l -A outside -p TCP -s $ANYWHERE -d $ANYWHERE 2049 -j DENY $IPCHAINS -l -A outside -p UDP -s $ANYWHERE -d $ANYWHERE 111 -j DENY $IPCHAINS -l -A outside -p UDP -s $ANYWHERE -d $ANYWHERE 2049 -j DENY # # Block XDM packets from outside, port 177 UDP $IPCHAINS -l -A outside -p UDP -s $ANYWHERE -d $ANYWHERE 177 -j DENY # # Block the YP/NIS port 653 $IPCHAINS -l -A outside -p TCP -s $ANYWHERE -d $ANYWHERE 653 -j DENY # # Don't bother logging accesses on TCP port 80, the www port. $IPCHAINS -A outside -p TCP -s $ANYWHERE -d $ANYWHERE 80 -j DENY # # Accept FTP data and control connections. $IPCHAINS -A outside -p TCP -s $ANYWHERE 20:21 -d $ANYWHERE 1024: -j ACCEPT # # Accept ssh packets $IPCHAINS -A outside -p TCP -s $ANYWHERE -d $ANYWHERE ssh -j ACCEPT # # Accept DNS packets from outside $IPCHAINS -A outside -p TCP -s $ANYWHERE -d $ANYWHERE 53 -j ACCEPT $IPCHAINS -A outside -p UDP -s $ANYWHERE -d $ANYWHERE 53 -j ACCEPT # # Accept SMTP from the world $IPCHAINS -A outside -p TCP -s $ANYWHERE -d $ANYWHERE 25 -j ACCEPT # # Accept NTP packets $IPCHAINS -A outside -p UDP -s $ANYWHERE -d $ANYWHERE 123 -j ACCEPT # # Accept no tap ident packets, we don't use them $IPCHAINS -A outside -p TCP -s $ANYWHERE -d $ANYWHERE 113 -j DENY # # Turn off and log all other packets incoming, TCP or UDP, on privileged ports $IPCHAINS -l -A outside -p TCP -s $ANYWHERE -d $ANYWHERE :1023 -y -j DENY $IPCHAINS -l -A outside -p UDP -s $ANYWHERE -d $ANYWHERE :1023 -j DENY # # Check against the portmapper ruleset $IPCHAINS -A outside -j portmap ############################################## # # End of "outside" rules chain # # ############################################## # # Block outgoing rwho packets $IPCHAINS -A output -p UDP -i $OUTSIDEIF -s $ANYWHERE 513 -d $ANYWHERE -j DENY # # Prevent netbios packets from leaving $IPCHAINS -A output -p UDP -i $OUTSIDEIF -s $ANYWHERE 137 -d $ANYWHERE -j DENY # # Turn on forwarding echo "1" > ${FORWARD_PROCENTRY}
¹æȺ®Àº ¿ÜºÎ¿¡¼ µé¾î¿À´Â ÆÐŶ¸¸À» »ó´ëÇÏ´Â °ÍÀÌ ¾Æ´Ï¶ó ´ç½ÅÀÇ ³»ºÎ ³×Æ®¿÷¿¡¼ºÎÅÍ ³ª°¡´Â rwho³ª netbios ÀÇ ³×Æ®¿÷ Á¤º¸¸¦ ´ãÀº ÆÐŶµéµµ °¨½ÃÇÑ´Ù.
¹Ì¸® ¸»ÇØ µÎ¾ú¾î¾ß Çϴµ¥ Æ÷Æ®¸ÅÆÛÀÇ ±ÔÄ¢Àº ¾à°£ ´Ù¸¥´Ù. ±×°ÍÀº Æ÷Æ®¸ÅÆÛ ÀÚ½ÅÀÌ ±â·ÏµÈ Æ÷Æ®¸ÅÆÛ µ¥¸ó ±â·ÏÀÌ ¾î¶² Æ÷Æ®°¡ ¿·Á ÀÖ´ÂÁö¸¦ ¸»Çϱ⠶§¹®ÀÌ´Ù. Ư¼öÇÑ µ¥¸ó¿¡ ÀÇÇØ »ç¿ëµÇ´Â Æ÷Æ®´Â ´ç½ÅÀÇ RPC ¼ºñ½º »ç¿ëÀÌ ¹Ù²ñ¿¡ µû¶ó ¹Ù²ð ¼ö Àְųª ȤÀº ±×µéÀÇ ±âµ¿ ¸í·É Àüȯ¿¡ µû¶ó ¹Ù²ð ¼ö ÀÖ´Ù. ÀÌ¿Í °°Àº ³»¿ëÀÇ ½ºÅ©¸³Æ®ÀÎ /sbin/firewall.portmap.sh ´Â Æ÷Æ®¸ÅÆÛ µ¥¸óÀ» À§ÇÑ ±ÔÄ¢À» µû¸£°í ÀÖ´Ù.
#! /bin/sh # ANYWHERE=0/0 IPCHAINS=/sbin/ipchains $IPCHAINS -F portmap # Rules for preventing access to portmapped services by people on the outside # /usr/bin/rpcinfo -p | tail +2 | \ { while read program vers proto port remainder do prot=`echo $proto | tr "a-z" "A-Z"` $IPCHAINS -l -A portmap -p $prot -s $ANYWHERE -d $ANYWHERE $port -j DENY || exit 1 done }
¿ì¸®´Â ³»ºÎ ³×Æ®¿÷¿¡¼ Àû¹ýÇÑ ÆÐŶÀÌ ³¯¾Æ¿À´Â °ÍÀ» °ÆÁ¤ÇÒ ÇÊ¿ä°¡ ¾øÀ¸¸ç Æ÷Æ®¸Ê üÀÎÀº ¿ÀÁ÷ ¿ÜºÎ¿¡¼ ³¯¾Æ¿À´Â °Í¸¸À» È®ÀÎÇÑ´Ù.
¹æȺ® ¼³Á¤ ·Î±×´Â kern.info¿Í ÇÔ²² ÇÏ´Â klogd¸¦ ÅëÇÏ¿© Àǽɽº·¯¿î °ÍµéÀ» ±â·Ï¿¡ ³²±ä´Ù. ÀÌ°ÍÀº ÀϹÝÀûÀÎ Á¢¼Ó ½Ãµµ¿¡µµ ¸¶Ä¡ ½ºÅÚ½ºÃ³·³ ¸ô·¡ »ìÇÉ´Ù.
ÀÚ, ¿ì¸®´Â ÀÌ·± °ÍµéÀ» ´Ù ¾Ë°Ô µÇ¾ú´Ù.¿ì¸®´Â ½Ã½ºÅÛÀÌ ½ÃÀ۵Ǵ µ¿¾È ÀÛÀº À©µµÀÇ ¾àÁ¡ÀÌ ¾øÀ½À» È®½ÅÇÏ´Â °ÍÀÌ ÁÁ´Ù. ±×·¯¹Ç·Î ¿ì¸®´Â ¿ì¸®ÀÇ ½ÃÀÛ °úÁ¤À» ´ÙÀ½°ú °°ÀÌ ¼³Á¤ÇÒ ÇÊ¿ä°¡ ÀÖ´Ù.:
#! /bin/sh # # Get the network started, securely # # /etc/rc.d/rc.inet1 # Configure the network interfaces # and set up routing. /sbin/firewall.sh || { echo "Firewall configuration failed" /sbin/ifconfig eth1 down } /sbin/ipchains -I outside 1 -j DENY # Deny all incoming packets /etc/rc.d/rc.inet2 # Start the network daemons sleep 5 # Let them stabilize # Secure the portmapped services /sbin/firewall.portmap.sh || { echo "Portmap firewall configuration failed" /sbin/ifconfig eth1 down } /sbin/ipchains -D outside 1 # Allow incoming packets
eth1 ÀÌ ¿ÜºÎ·Î º¸¿©Áö´Â IP¸¦ ÇÒ´ç¹Þ°í ÀÖ´Ù°í °¡Á¤ÇÏÀÚ. ¾î¶² ipchains ±ÔÄ¢ÀÌ ¼³Á¤¿¡ ½ÇÆÐÇÏ¿´´Ù¸é, °æ°í ¸Þ½ÃÁö°¡ ¶ã °ÍÀÌ´Ù. ``¿ÜºÎÀÇ'' üÀÎÀº ¹æȺ®ÀÇ ¼ºñ½º´Â Æ÷Æ®¸ÅÆÛÀÇ ¼ºñ½º°¡ ±âµ¿µÇ±â Àü¿¡´Â »ç¿ëÇÒ ¼ö ¾ø´Â ±ÔÄ¢À̹ǷΠ³×Æ®¿÷ ¼ºñ½º µ¥¸óÀÌ ±âµ¿µÇ±â Àü¿¡´Â ¸ðµç ÆÐŶÀ» °ÅºÎÇÒ °ÍÀÌ´Ù. Æ÷Æ®¸Ê ¼ºñ½º°¡ ¹æȺ®ÀÇ ¿ªÇÒÀ» Çϸç, ¿ÜºÎÀÇ Ã¼ÀÎÀ» ÀçÀνÄÇÏ´Â °ÍÀÌ´Ù.
ÀÌ ±ÛÀ» ¾²´Â ½ÃÁ¡¿¡¼ OpenSSH´Â ³»°¡ ¿©±â ¾ð±ÞÇϴ Ư¡ Áß Çϳª¸¦ Á¦°øÇÏÁö ¾Ê´Â´Ù. ±×·¯³ª OpenSSH´Â ¾ÆÁÖ È°¹ßÈ÷ ¹ßÀüµÇ°í ÀÖÀ¸¹Ç·Î, ÀÌ°ÍÀº ¾ðÁ¦¶óµµ ¹Ù²ð ¼ö ÀÖ´Â ºÎºÐÀÌ´Ù. ºüÁ® ÀÖ´Â ±î´Ù·Î¿î Ư¡Àº ´ç½ÅÀÌ scp, ssh, slogin µîÀ» rcp, rsh, rlogin µîÀÇ À̸§À¸·Î ¹Ù²Ù¾î, rcp, rsh, rlogin µîÀÇ ¿ø·¡ÀÇ ÇÁ·Î±×·¥ÀÌ sshÀÇ Å¬¶óÀ̾ðÆ® ÇÁ·Î±×·¥À¸·Î ¹Ù²î¾î, sshdÀÇ ÀÛµ¿ ¾øÀÌ´Â »ç¿ëÇÒ ¼ö ¾ø°Ô ÇÏ´Â ¼³Á¤¿¡ °üÇÑ °ÍÀÌ´Ù. rsh¸¦ »ç¿ëÇÏ¸ç ±â¿øÀ» ÇÏ´Â ´ë½Å ssh Ŭ¶óÀ̾ðÆ® ÇÁ·Î±×·¥À» »ç¿ëÇÏ¿© »ç¿ëÀÚµéÀÇ º¸¾È ¹®Á¦¸¦ °£´ÜÈ÷ ÇØ°áÇÒ ¼ö ÀÖ´Â °ÍÀÌ´Ù. ¸ðµç À̵éÀÇ ½ºÅ©¸³Æ®·Î, rdist ¼³Á¤°ú ¿ø°ÝÀÇ sshd°¡ ÀÛµ¿ÇÏ´Â ¿ø°Ý »çÀÌÆ®¿¡¼ ¼öÁ¤ ¾øÀÌ ÀÛ¾÷À» Áö¼ÓÇÒ ¼ö ÀÖ´Ù. ±×·¯³ª µ¥ÀÌÅÍ´Â ¾ÏÈ£ÈµÇ¾î º¸³»Áö¸ç ÀÌ°ÍÀÌ °·ÂÇÑ È®ÀÎÀÌ µÇ´Â °ÍÀÌ´Ù.
À¥ »çÀÌÆ® www.ssh.org/¿¡¼ ssh1À» ±¸ÇÏ°í, ±×°ÍÀ» ÄÄÆÄÀÏÇÏ¿© ¾ÏȣȵÇÁö ¾ÊÀº r-ÇÁ·Î±×·¥µé(rsh, rlogin, rcp µî)°ú ´ëüÇ϶ó. ¸ÕÀú, ±× ¼¼ °¡Áö ÆÄÀϵéÀ» /usr/lib/rsh¿¡ º¹»çÇØ ³Ö°í, ssh ÆÐÅ°Áö¸¦ ´ÙÀ½°ú °°ÀÌ ¼³Á¤Ç϶ó.:
./configure --with-rsh=/usr/lib/rsh/rsh --program-transform-name='s/^s/r/' --prefix=/usr
¼³¸í¿¡ µû¶ó ½ÇÇà ÆÄÀÏÀ» ¼³Ä¡ÇÏ°í ¼³Á¤ÇÑ´Ù. »ç¼³ ³×Æ®¿÷ °ÔÀÌÆ®¿þÀÌ¿¡¼ sshd ¼³Á¤Àº ´ÙÀ½°ú °°Àº ¿£Æ®¸®¸¦ Á¤ÀÇÇÒ °ÍÀÌ´Ù.:
ListenAddress 192.168.1.1 # fred's internal IP IgnoreRhosts no X11Forwarding yes X11DisplayOffset 10 RhostsAuthentication no RhostsRSAAuthentication yes RSAAuthentication yes PasswordAuthentication yes´ç½ÅÀº /etc/sshd_config ÆÄÀÏ ¾È¿¡ ´Ù¸¥ ¿£Æ®¸®¸¦ ¼³Á¤Çؾ߸¸ ÇÏ°Ô µÉ °ÍÀÌ´Ù. ±×·¯³ª ±× Çʵ带 ¹Ù²ÙÁö ¾Êµµ·Ï ÇÏÀÚ. ´ç½ÅÀÌ ÀÌ ÆÄÀÏ ¾È¿¡ ´ç½ÅÀÌ °í·ÁÇÒ ¸ðµç ¿£Æ®¸®¸¦ °®°í ÀÖ´Ù¸é, ±× ¿£Æ®¸® ÆÄÀÏÀ» »õ ÆÄÀÏÀÎ /etc/sshd_config.ext ¿¡ ¿ÜºÎÀÇ ³×Æ®¿÷À» À§ÇØ º¹»çÇØ ³Ö¾î¶ó. »õ ÆÄÀÏ¿¡¼ ´ÙÀ½ µÎ °³ÀÇ Çʵå´Â ¼öÁ¤ÇÏ¿©¶ó. :``ListenAddress''´Â »ç¼³ ³×Æ®¿÷ÀÇ IP¸¦ ¿ÜºÎ·Î º¸¿©Áú ¼ö ÀÖ´Â À̸§À¸·Î ±³Ã¼ÇÏ´Â °ÍÀÌ´Ù. ¿¹¸¦µé¸é 10.1.1.9°¡ fred.example.comÀ¸·Î ¹Ù²Ù´Â °ÍÀÌ ÀÖ°Ú´Ù. ±×¸®°í ``PasswordAuthentication''Àº ``no''·Î ¼³Á¤Çضó. ´ç½ÅÀÇ ³×Æ®¿÷À» ±âµ¿ÇÏ´Â ½ºÅ©¸³Æ®¿¡¼, sshd¸¦ 2¹ø ½ÃÀÛÇϵµ·Ï Ç϶ó. ÇÑ ¹øÀº
/usr/sbin/sshd¿Í °°ÀÌ, ´Ù½Ã ÇÑ ¹øÀº
/usr/sbin/sshd -f /etc/sshd_config.extÀÇ ½ÄÀÌ´Ù.
ÀÌ°ÍÀº 2°³ÀÇ sshd µ¥¸óÀ» ±âµ¿½ÃŲ´Ù. Çϳª´Â ³»ºÎ ÀÎÅÍÆäÀ̽ºÀÇ ·Î±×ÀÎ ½ÃÀÇ Æнº¿öµå¸¦ üũÇÏÁö¸¸ ´Ù¸¥ °ÍÀº ¿ÜºÎ ÀÎÅÍÆäÀ̽º¿¡¼ RSAÅ°¸¦ ´©±º°¡°¡ ·Î±×ÀÎ Çϱâ Àü¿¡ Æ÷ÇÔÇÏ°Ô ÇÑ´Ù.
´ÙÀ½À¸·Î, ³»ºÎ·Î µé¾î¿À´Â telnet°ú ¼Ð ¼ºñ½º¸¦ inetd ¼³Á¤ ÆÄÀÏ¿¡¼ ²ôµµ·Ï ÇÑ´Ù. ÀÌ ºÎºÐÀº ¹æȺ® ¼³Á¤¿¡ °üÇÑ ¼½¼Ç¿¡¼ À̺ñ ¿ÜºÎ¿¡¼ÀÇ Á¢±ÙÀ» ¸»ÇÒ ¶§ ¾ð±ÞÇÑ ¹Ù ÀÖ´Ù. ±×·¯³ª ÀÌ°ÍÀº ¹æ¾î¿¡ À־¸ ÁÁÀº »ý°¢ÀÌ´Ù. ¸ðµç ÀÛ¾÷À» ¼øÁ¶·ÎÀÌ ÇÒ ¼ö´Â ¾øÀ» Áöµµ ¸ð¸¥´Ù´Â ¶æÀÌ´Ù.
Áý¿¡¼, ȤÀº µµ½Ã ¹Û¿¡¼ ·Î±×ÀÎÀ» ¿øÇÏ´Â »ç¶÷µéÀº RSA Å°°¡ ÇÊ¿äÇÏ´Ù. ±×µéÀº ¾î¶»°Ô ÇØ¾ß ÇÒ Áö ¾Ë°í ÀÖÀ¸¸ç, ±×µéÀº telnetd¸¦ ´ç½ÅÀÇ ¹æȺ®»óÀÇ Æò¹üÇÑ Æ÷Æ®¿¡ µÎ´Â °Í°ú °°Àº ´Ù¸¥ ¹æ¹ýÀ¸·Î ±×·± ÀÏÀ» ÇÏ¿© ÀÚ½ÅÀÇ ¿¡³ÊÁö¸¦ ¼Ò¸ðÇÏ°í ½Í¾îÇÏÁö ¾Ê´Â´Ù.
RSA Å°ÀÇ »ý¼ºÀº ´ÙÀ½°ú °°Àº ¸í·ÉÀ¸·Î ÀÌ·ç¾îÁø´Ù.:
ssh-keygen -b 1024 -f new_rsa_key´ç½ÅÀº Æнº ÆäÀÌÁî·ÎºÎÅÍ ÈùÆ®¸¦ ¹ÞÀ» °ÍÀÌ´Ù. ÀÌ°ÍÀº °ø¹éÀÌ µÇ¾î¼´Â ¾È µÉ °ÍÀÌ´Ù. ÆÄÀÏ new_rsa_key·Î Á¢±ÙÇÏ°í, Æнº ÆäÀÌÁ ¾Ë°í ÀÖ´Â ¾î¶² »ç¶÷ÀÌ ¸ðµç RSA ÀÎÁõ °úÁ¤À» Åë°úÇϱâ À§ÇÑ ¸ðµç ÇÊ¿ä Á¶°ÇÀ» °®°í ÀÖ´Â °ÍÀÌ´Ù. Æнº ÆäÀÌÁî´Â À¯ÃßÇØ ³¾ ¼ö ¾ø´Â Æнº¿öµåÀ̰ųª ÀϹÝÀûÀÌÁö ¾ÊÀº ±ä ¹®Àå À̾î¾ß ÇÑ´Ù. ÆÄÀÏ new_rsa_key´Â Ç÷ÎÇÇ µð½ºÅ©, ·¦Å¾¾Ö º¹»çµÉ ¼ö ÀÖÀ¸¸ç Æнº ÆäÀÌÁî¿¡ ¼ÓÇÏ¿© °èÁ¤¿¡ ·Î±×ÀÎÇÏ´Â »ç¶÷¿¡ ´ëÇØ Æ¯Á¤ÇÑ RSA Å°¸¦ Çã°¡ÇÑ´Ù.
Ư¼öÇÑ RSAÅ°¿¡ ÀÇÇØ °èÁ¤¿¡ ´ëÇÑ Á¢±Ù Çã°¡°¡ ÀÌ·ç¾îÁö´Â ¼³Á¤¿¡¼, °¡Àå ´Ü¼øÇÑ »ý¼ºÀº »ç¼³ ³×Æ®¿÷ °ÔÀÌÆ®¿þÀÌ(ÀÌ ÄÄÇ»ÅÍ´Â ·Î±×ÀÎ Á¢±ÙÀ» µ¹·Á º¸³¾ °ÍÀÌ´Ù.)¿¡ »ç¿ëÀÚ¸¦ À§ÇÑ $HOME/.ssh/ µð·ºÅ丮¸¦ »ý¼ºÇÏ¿© $home/.ssh/authorized_keys ÆÄÀÏ ¾ÈÀÇ ssh-keygen ¸í·ÉÀ¸·Î ÀÎÇÏ¿© »ý¼ºµÈ new_rsa_key.pub ¸¦ º¹»çÇØ ³Ö´Â °ÍÀÌ´Ù. sshd ¸Å´º¾ó ÆäÀÌÁö¿¡¼ ½Å·ÚÇÏ´Â IP, ȤÀº È£½ºÆ® À̸§À» °¡Áø °÷¿¡¼ ¿À´Â ·Î±×ÀÎ ¿äûÀ̳ª ȤÀº ¿ÜºÎ¿¡¼ º¸³»¾îÁø, ÀÎÁõÀ¸·Î ÅëÇØ ½Å·Ú°¡ °¡´ÉÇÑ ¸í·ÉÀÇ °æ¿ì¿¡¼ ´ç½ÅÀÌ Ãß°¡ÇØ ³ÖÀ» ¼ö ÀÖ´Â ´Ù¸¥ ¿É¼Ç Å°µé¿¡ °üÇÑ ¼³¸íÀ¸·Î¼ ³ª¿Í ÀÖ´Â ``AUTHORIZED_KEYS FILE FORMAT'' ¼½¼ÇÀ» º¸¸é Àß ³ª¿Í ÀÖ´Ù. (¿¹¸¦ µéÀÚ¸é, RSA Å°ÀÇ ´Ù¸¥ °÷À¸·Î, ȤÀº ´©±º°¡¿¡°Ô ¸ÞÀÏ·Î º¸³»¾î ¹é¾÷ÇÏ´Â °æ¿ì µî.)
RSA Å° ¸ÞÄ«´ÏÁòÀ» °¡´ÉÇÑÇÑ »ç¿ëÀÚ ¿ì¼±À¸·Î ¸¸µå´Â µ¥ ÀÌÁ¦ ÇÑ °¡Áö°¡ ³²¾Ò´Ù. ¸¸¾à ¾î¶² »ç¿ëÀÚ°¡ ÇѵΠ¹øÀÇ °úÁ¤À» °ÅÃÄ Æнº ÆäÀÌÁ ¾Ë¾Æ ³»°Ô µÈ´Ù¸é, ±×´Â ½º½º·Î°¡ º¸¾ÈÀÇ ±¸¸ÛÀÌ µÇ¾î º¸¾È»óÀÇ ¹®Á¦¸¦ ÀÏÀ¸Å³ °¡´É¼ºÀ» ½º½º·ÎÀÇ ¼Õ ¾È¿¡ °®°í ÀÖ´Â °ÍÀÌ´Ù. ¸®´ª½º¿¡¼, ·Î±×ÀÎ ½©Àº ssh-agent ±â¹ÝÀ¸·Î ºÒ·¯Áø´Ù. ¿¹¸¦ µé¾î ¸¸¾à ¾÷¹«¿ëÀ¸·Î »ç¿ëµÇ´Â ȸ»çÀÇ ·¦Å¾¿¡¼ ½Ç¼ö·Î xdmÀÌ ½ÇÇàµÇ¾î »ç¿ëÀÚ¿¡°Ô X ¼¼¼ÇÀÇ ±ÇÇÑÀÌ ³Ñ¾î°¡°Ô µÈ´Ù¸é, /var/X11R6/lib/xdm/Xsession_0 À» ¿¾î ½Ãµ¿µÉ ¶§ ºÒ·¯Áö´Â ´ÙÀ½ÀÇ ÇàÀ» °¡´ÉÇÏ¸é ´ÙÀ½°ú °°ÀÌ ¹Ù²Ùµµ·Ï Ç϶ó.:
exec "$startup"ÀÌ ÇàÀ» ÀÌ·¸°Ô ¹Ù²ã¶ó.:
exec ssh-agent "$startup"³ªÀÇ xdm ¼³Á¤¿¡¼, ±× ÆÄÀÏ¿¡¼ °¢°¢ÀÇ 3ÁÙÀÌ ¹Ù²î¾îÁ³´Ù. »ç¿ëÀÚ°¡ ·¦Å¾¿¡ ·Î±×ÀÎÇÒ ¶§, ±×´Â ´ÙÀ½ÀÇ ¸í·ÉÀ» ÀÔ·ÂÇؾ߸¸ ÇÏ´Â °ÍÀÌ´Ù.
ssh-add new_rsa_key·Î±×ÀÎ ÇÁ·ÒÇÁÆ®°¡ ¶°¼ Æнº ÆÐÀÌÁ ÀÔ·Â ¹Þ¾Æ¼ºÎÅÍ, »ç¿ëÀÚ°¡ ±×ÀÇ X ¼¼¼ÇÀ» ·¦Å¾¿¡¼ Á¾·áÇÒ ¶§ ±îÁö, »ç¼³ ³×Æ®¿÷ ¾ÈÀÇ ¸ðµç À©µµ¿¡¼ Æнº ÆäÀÌÁî ¾øÀÌ Á¢±ÙÇÒ ¼ö ÀÖ±â À§Çؼ ÇØ¾ß ÇÒ ÀÏÀÌ´Ù.
sshd °¡ ´ç½ÅÀÇ »ç¼³ ³×Æ®¿÷»óÀÇ ¸ðµç ÄÄÇ»ÅÍ¿¡¼ ¿ÜºÎÀÇ È£½ºÆ®¿¡ ´ëÇÏ¿© ÀÛµ¿ÇÏ°í ÀÖ´Ù. »ç¼³ ³×Æ®¿÷ »óÀÇ °ÍÀÌ ¾Æ´Ñ ÄÄÇ»ÅÍ¿¡ ´ëÇÏ¿© ListenAddress ¿£Æ®¸®¸¦ /etc/sshd_config ¾È¿¡ ``0.0.0.0''¿Í °°ÀÌ ¼³Á¤ÇÒ ¼öµµ ÀÖ´Ù. ´ç½ÅÀº ´ÙÀ½ ¸í·ÉÀ» ÅëÇØ È£½ºÆ® Å°¸¦ ¼³Á¤ÇÒ ¼ö ÀÖ´Ù:
ssh-keygen -b 1024 -f /etc/ssh_host_key -N ""make-ssh-known-hosts¸¦ ½ÇÇàÇÏ°í /etc/ssh_known_hosts ÆÄÀÏ ¾È¿¡ »ç¼³ ¹× °ËÁõµÈ ³×Æ®¿÷ÀÇ ¸ðµç ÄÄÇ»Å͸¦ ºÐ·ùÇÏ´Â °ÍÀÌ´Ù.
¾ÏȣȵÇÁö ¾ÊÀº r-¼ºñ½ºµé°ú ÅÚ³ÝÀÇ ¿ÜºÎ¿¡¼ ¾ÈÀ¸·Î µé¾î¿À´Â Á¢¼ÓÀ» ¹«·ÂÇÏ°Ô ÇÑ´Ù. ÅÚ³ÝÀÇ ½ÇÇà ÆÄÀÏÀ» Áö¿ï °ÍÀº ¾ø´Â °ÍÀÌ ÀÌ°ÍÀº Æ÷Æ® 23¹ø »óÀÇ ´Ù¸¥ ÅÚ³Ý ¼¼¼Çµéº¸´Ù À¯¿ëÇÑ °ÍÀ̴ϱî. ´ç½ÅÀº »ç¼³ ³×Æ®¿÷ »ó¿¡¼ Æнº¿öµå¸¦ ÀÌ¿ëÇÑ ÀÎÁõÀ» »ç¿ëÇÏ¿© ¿ÜºÎ·ÎºÎÅÍÀÇ Á¢¼ÓÀ» Â÷´ÜÇÏ°í ¿ÜºÎÀÇ È£½ºÆ®¿¡¼ º¸³»¾îÁø RSAÅ°¸¦ ·Î±×¿¡ ³²±æ ¼öµµ ÀÖ´Ù.
ÀÌ°ÍÀº »ç¼³ ³×Æ®¿÷»óÀÇ È£½ºÆ®µåÀÌ °¢°¢ÀÇ /etc/hosts.equiv ÆÄÀÏ »ó¿¡ ±â·ÏµÇ¾î ÀÖÀ» °Ï¿ì »ç¿ëÀڵ鿡°Ô Æí¸®ÇÑ °ÍÀÌ´Ù. sshd µ¥¸óÀº ±×°Íµé¿¡ ÀÇÇØ »ç¶÷µéÀÇ rlogin°ú rsh¸¦ ÄÄÇ»ÅÍµé °£¿¡ Æнº¿öµå³ª Æнº ÆäÀÌÁî ¾øÀÌ °¡´ÉÇÏ°Ô ÇÑ´Ù. ¸ðµç Á¢¼Ó¿¡ ÀÖ¾î¼, ÄÄÇ»Å͵éÀº È£½ºÆ® ·¹º§ RSA Å°¸¦ ÅëÇÏ¿© °¢°¢ÀÇ µ¿ÀϼºÀ» Áõ¸íÇؾ߸¸ ÇÏ´Â °ÍÀÌ´Ù.
»ç¿ëÀÚ°¡ ¿ÜºÎ ³×Æ®¿÷ÀÇ IP¸¦ °¡Áø ÄÄÇ»ÅÍ¿¡¼ºÎÅÍ »ç¼³ ³×Æ®¿÷ »óÀÇ ÄÄÇ»ÅÍ·Î ·Î±×ÀÎÀ» Çϱ⸦ ¿øÇÒ ¶§ ´Ù¸¥ °ÍÀÌ ³ªÅ¸³´Ù. ´ç½ÅÀº /etc/hosts.equiv ȤÀº $HOME/.shosts¸¦ Æнº¿öµå ÀÎÁõ °úÁ¤ ¾øÀÌ ÀÌ¿ëÇÒ ¼ö ¾ø°Ô µÈ´Ù. ±×°ÍÀº »ç¿ëÀÚ°¡ °ËÁõµÇÁö ¾ÊÀº IP-ÀÌ°ÍÀº ¸Å½ºÄ¿·¹À̵ù µÈ °ÍÀϼöµµ, ¹æȺ®ÀÏ ¼öµµ ÀÖÁö¸¸ È£½ºÆ® Å°°¡ ÀÏÄ¡ÇÏÁö´Â ¾ÊÀ» °ÍÀÌ´Ù. -¸¦ °¡Áø °÷¿¡¼ µé¾î ¿Ô±â ¶§¹®ÀÌ´Ù. ÀÌ¿¡´Â µÎ °¡Áö ÇعýÀÌ ÀÖ´Ù. ÇÑ °¡Áö´Â ´ç½ÅÀÌ /etc/hosts.equiv ³ª $HOME/.shosts ¸Þ¼Òµå¸¦ »ç¿ëÇÒ °ÍÀ» ÁÖÀåÇÒ °æ¿ìÀε¥, ÀÌ ¶§´Â »ç¿ëÀÚµéÀÌ »ç¼³ ³×Æ®¿÷¿¡ ·Î±×¸¦ ³²°Ü¾ß¸¸ ÇÒ °ÍÀÌ´Ù. ±×¸®°í ÀÌ ·Î±×´Â µé¾î¿À±â¸¦ ½ÃµµÇÑ ¿ÜºÎÀÇ ÄÄÇ»ÅÍ¿¡µµ ³²À» °ÍÀÌ´Ù. ´Ù¸¥ ¹æ¹ýÀº RSA Å° ¾ÈÁõÀ» ÀÌ¿ëÇÏ´Â °ÍÀÌ´Ù. ±×°ÍÀº ¾î¶² IP¿¡¼ È£½ºÆ® À̸§À¸·Î lookupÀ» ½ÃµµÇÏ´Â ºÎÁÖÀÇ¿¡µµ ¾ðÁ¦³ª ÀÛµ¿ÇÑ´Ù.
¸¹Àº À¯ÀúµéÀÌ º¸¾Èº¸´Ù´Â Æí¸®ÇÔÀ» Ãß±¸Çϱ⠶§¹®¿¡ °è¼Ó ¿©·¯ ¸ðÀÇ Å½»öÀ» ÇØ ³ª°¡°í ÀÖ´Ù. ÀÌ°ÍÀº ¸¹Àº »ç¶÷µéÀÌ ´ÙÀ½°ú °°ÀÌ ½ÇÇàÇÏ°Ô ÇÑ´Ù.
xhost +ÀÌ ¸í·ÉÀº X¸¦ ÃʱâÈ ÇÏ´Â °ÍÀÌ´Ù. ÀÌ·± Çã°¡¸¦ ¹ÞÀº X¼¹ö´Â ¼¼°èÀÇ ´©±¸¶óµµ Á¢±ÙÇÒ ¼ö ÀÖ°Ô µÈ´Ù. ¿ÜºÎÀÇ ¾î¶² ÀÓÀÇÀÇ »ç¿ëÀÚ°¡ ´ç½ÅÀÇ ·çÆ®ÀÇ À©µµ ȸ¸éÀ» ´ç½ÅÀÌ ÁöÁ¤ÇÑ °Í¿¡¼ ´ç½ÅÀÇ »ó°üÀÌ Àڱ⠾î¸Ó´Ï¿¡°Ô »ç¹«½ÇÀ» ±¸°æ½ÃÄÑ ÁÖ´Ù°¡ °æ¾ÇÇÏ°Ô ÇÒ ¸¸ÇÑ °ÍÀ¸·Î ¹Ù²Ù¾î ³õÀ» ¼öµµ ÀÖ°Ô µÈ´Ù´Â ¶æÀÌ´Ù. ÀÌ·± ¿ÜºÎÀÎÀº ´ç½ÅÀÇ ¸ð´ÏÅ͸¦ Á¦¾îÇÏ°í ´ç½ÅÀÇ ½ºÅ©¸° »ó¿¡ ¶ç¿öÁö´Â ³»¿ëÀ» ³Ñ°Ü º¼ ¼öµµ ÀÖ´Â °ÍÀÌ´Ù. ¾µ µ¥ ¾ø´Â ÀܼҸ®Áö¸¸, ÀÌ°ÍÀº ´ç½ÅÀÌ ´Ù¸¥ »çÀÌÆ®ÀÇ ·Î±×Àημ Æнº¿öµå¸¦ ³Ñ±â´Â °Í ȤÀº ¹Î°¨ÇÑ »ç¾ÈÀÇ ¹®¼¸¦ ȸ鿡 ¶ç¿ö ¼öÁ¤ÇÏ´Â »óȲÀ» »ý°¢Çϸé ÁÁÀ» °Ô ¾ø´Â »óȲÀ̶ó´Â°ÍÀ» ½±°Ô ¾Ë ¼ö ÀÖÀ»°ÍÀÌ´Ù. xhost ÇÁ·ÎÅäÄÝ ÀÚ½ÅÀº º»·¡ºÎÅÍ »ç¿ëÀÚ ±â¹ÝÀ¸·Î ȸéÀ» »ç¿ëÇÒ ±ÇÇÑÀ» ¾çµµÇÏ´Â °ÍÀÌ ºÒ°¡´ÉÇÑ ÇѰ踦 °®°í ÀÖ°í, ¿ÀÁ÷ ±â°è ±â¹ÝÀÎ °ÍÀÌ´Ù.
xauth ÀÎÁõ¿¡ µé¾î°¡ÀÚ. ¸¸¾à ´ç½ÅÀÌ xdm À» °¡Áö°í ÀÖ´Ù¸é ´ç½ÅÀº ¾Æ¸¶ ÀÌ¹Ì xauth ÀÎÁõÀ» ½ÇÇàÇÏ°í ÀÖÀ» °ÍÀ̵𸸠xhost°¡ ¿©ÀüÈ÷ µ¹°í ÀÖ´Ù. ±×¸®°í ¾Æ¸¶µµ »ç¶÷µéÀº ÄÄÇ»ÅÍ »çÀÌ¿¡¼ XÀÇ ÇÁ·Î¼¼½º¸¦ »ç¿ëÇÏ°í ÀÖÀ» °ÍÀÌ´Ù. ´Ù½Ã ¸»ÇÏÀÚ¸é, ÀÌ°ÍÀÇ °á·ÐÀº »ç¿ëÀÚµéÀÌ xhost ¸í·ÉÀ» ´õ ÀÌ»ó »ç¿ëÇÏÁö ¾Ê°íµµ »ç¿ëÇϱ⠽±°Ô, º¸¾È°ú Æí¸®ÇÔÀ» ÇÔ²² ´©¸®ÀÚ´Â °ÍÀÌ´Ù.
``SSH1 ¼³Á¤'' ¼½¼Ç¿¡¼ ``X11 Æ÷¿öµù'' À» ±âº» Áö½ÄÀ¸·Î ÇÏ¿© sshd ¼Â¾÷À» ¹¦»çÇÑ °ÍÀº xhost Å×Å©´Ðº¸´Ù »ç¿ëÇϱ⠽¬¿î °ÍÀÌ´Ù. ´ç½ÅÀÌ ´ç½ÅÀÇ Å͹̳ο¡ Á¢¼ÓÇÒ ¶§ ´ç½ÅÀº °£´ÜÈ÷ rloginÀ¸·Î ¿ø°ÝÁö ÄÄÇ»ÅÍ¿¡ µé¾î°¡ ³Ý½ºÄÉÀÌÇÁ³ª xv, ȤÀº ´Ù¸¥ ÁÁ¾ÆÇÏ´Â °ÍµéÀ» $DISPLAY º¯¼ö¸¦ Á¶Á¤Çϰųª Á¢±Ù ±ÇÇÑÀ» ¾òÁö ¾Ê°íµµ »ç¿ëÇÒ ¼ö ÀÖ´Ù. ssh ·Î±×ÀÎÀº »ç¿ëÀÚ¿¡°Ô Åõ¸íÇÑ ¹æ½ÄÀ¸·Î ¼³Á¤ÇÏ°í, °¢°¢ÀÇ ´ç½ÅÀÇ X ÆÐŶ¿¡ °üÇÑ ¾Ïȣȴ ±×µéÀÌ ³×Æ®¿÷À» ¶°³ª±â Àü±îÁö Áö¼ÓµÈ´Ù.
¸¸¾à ´ç½ÅÀÌ sshd X11Æ÷¿öµùÀ» ¾î¶² ÀÌÀ¯·Î ÀÌ¿ëÇÒ ¼ö ¾ø´Ù¸é, ´ç½ÅÀº xauth¸¦ ´ç½ÅÀÌ ´ç½ÅÀÇ X ¼¹ö¿¡ Á¢±ÙÇϱ⸦ Á¦ÇÑÇÏ´Â ´Ù¸¥ ÄÄÇ»Å͵鿡 ´ëÇÑ ÀÎÁõÃ¥À¸·Î ¾µ ¼ö ÀÖ´Ù. »ç¿ëÀÚ¸¦ À§ÇÑ È¤Àº Ưº°ÇÑ ±×µéÀ» µµ¿ï ¼ö ÀÖ´Â ¼¿ ½ºÅ©¸³Æ®µéÀÌ ±â¼úµÇ¾î ÀÖ´Â ¹®¼µéÀÌ ÀÖ´Ù. ``jpublic'' ÄÄÇ»Åͻ󿡼´Â ``barney''ÀÇ ´ç½ÅÀÇ X ¼¹ö¿¡ Á¢±ÙÇϱâ À§ÇÑ °ü·ÃµÈ ¸í·ÉÀ¸·Î ´ÙÀ½ÀÌ ÀÖ´Ù.:
/usr/X11/bin/xauth extract - $DISPLAY | rsh -l jpublic barney /usr/X11/bin/xauth merge -³ª´Â xhost¸¦ ´ç½ÅÀÇ ÄÄÇ»ÅÍ ¿£Æ®¸®¿¡¼ Áö¿ì·Á´Â À¯È¤À» ¹Þ´Â ÆíÀÌ´Ù. ¸¸¾à ±×°ÍÀÌ ¾î¶² ÇÁ·Î±×·¥¿¡ ¹®Á¦°¡ µÈ´Ù¸é ´ç½ÅÀº ÃÖ¼ÒÇÑ ±×°ÍÀÌ º¸¾È¿¡ ¾àÇÑ °ÍÀ̶ó´Â Á¡Àº ¾Ë ¼ö ÀÖ´Â °ÍÀÌ´Ù. ÀÌ°ÍÀº xauth ½ÃÄö½º ¸®½ºÆ®¸¦ »ç¿ëÇÏ´Â xhost¸¦ À§ÇÑ µÇµ¹·Á ³õ´Â ¼Ð ½ºÅ©¸³Æ®¸¦ ÀÛ¼ºÇÏ´Â °ÍÀ¸·Î ÃæºÐÇÏ´Ù.
rshÀÌ ssh ÇÁ·Î±×·¥À» ¾ÏÈ£È ÇÏÁö ¾Ê¾ÒÀ» ¶§, xauth Å°´Â ´Ü¼øÇÑ ÅؽºÆ®·Î¼ º¸³»Áú »ÓÀ̶ó´Â Á¡À» ±â¾ïÇÏÀÚ. ±×°ÍÀ» ÀÔ¼öÇÑ ´©±¸¶óµµ ´ç½ÅÀÇ ¼¹ö¿¡ Á¢±ÙÇÒ ¼ö ÀÖ´Ù. ±×·¯¹Ç·Î ´ç½ÅÀº ¾ÏÈ£È °úÁ¤À» À§ÇØ ssh¸¦ »ç¿ëÇÏÁö ¾Ê¾Ò´Ù¸é ´õ ¸¹Àº º¸¾ÈÀ» ±â´ëÇؼ´Â ¾È µÇ´Â °ÍÀÌ´Ù. °Ô´Ù°¡ »ç¿ëÀÚÀÇ È¨ µð·ºÅ丮°¡ NFS ·Î ¿ÜºÎ¿¡ ³ëÃâµÇ¾î ÀÖ´Ù¸é, xauth Å°´Â ±× ´©±¸¶óµµ NFS ÆÐŶÀ» ÅëÇØ Ã¤¾î °¥ ¼ö ÀÖ´Ù´Â Á¡À» ±â¾ïÇÏ°í ssh¸¦ ´ç½ÅÀÇ ½Ã½ºÅÛ¿¡¼ ±âµ¿½ÃÄÑ¾ß ÇÑ´Ù´Â °ÍÀ» »ý°¢ÇÏÀÚ.
¼¹ö·Î ¸ÞÀÏÀÌ ¿ÔÀ» ¶§ ±×°ÍÀ» ¾î¶² °÷¿¡¼µµ ÀÐ°í ¸ÞÀÏÀ» º¸³¾ ¼ö ÀÖ°Ô ÇÑ´Ù¸é Æí¸®ÇÒ °ÍÀÌ´Ù. ±×·¯³ª ½É½ÉÇÏ°í µûºÐÇÑ ³ª¸ÓÁö ¸øµÈ ÁþÀ» ÇØ º¸·Á ¼¼º´ë´Â ÀÏ¹Ý À¯Àúµé¿¡ ´ëÇÑ ¾à°£ÀÇ ÁÖÀÇ´Â ±â¿ï¿©¾ß ÇÑ´Ù. AUTH_DES ÀÇ ½ÇÇà ¾øÀÌ NFS¸¦ »ç¿ëÇÏ´Â °ÍÀº ¹«¹æºñ »óųª ´Ù¸§¾ø´Ù. NFSÀÇ Å¬¶óÀ̾ðÆ® ¿¡ ´ëÇÑ ½Å·Ú °ü°è´Â Á¢±ÙÀ» º¸ÀåÇÏ´Â °ÍÀÌ´Ù. ±×°ÍÀº ¼¹ö¿¡¼ÀÇ Æнº¿öµå ÀÎÁõ ¾øÀ̵µ Ŭ¶óÀ̾ðÆ®¿¡¼ °¢°¢ÀÇ °³ÀÎÀÎ ÀÚ½ÅÀÇ ÆÄÀÏ¿¡ Á¢±ÙÇÒ ¼ö ÀÖ´Ù´Â °ÍÀÌ´Ù. À©µµÀÇ °æ¿ì¿¡´Â À¯´Ð½º ½ÄÀÇ ÆÄÀÏÀÇ Á¢±Ù Á¦ÇÑÀ» ¿Ïº®ÇÏ°Ô ¹«½ÃÇÏ°í NFS ÀûÀÎ °øÀ¯¸¦ ¾î¶² uid ¾øÀ̵µ °¡´ÉÇÏ°Ô ÇÑ´Ù. µû¶ó¼ NFS´Â ¸®´ª½º ¹Ú½º ³ª À¯´Ð½ºÃ³·³ ´ç½ÅÀÇ Áï°¢ Á¶Á¤ÀÌ °¡´ÉÇÑ ÇÏ¿¡¼¸¸ ¼³Á¤ÇØ¾ß ÇÑ´Ù. ¹°·Ð À©µµ·Î µà¾ó ºÎÆÃÀÌ µÇ´Â ÄÄÇ»ÅÍ¿¡µµ Çؼ± ¾È µÉ °ÍÀÌ´Ù. ¸¸ÀÏ ´ç½ÅÀÌ ¸ÞÀÏ ½ºÇ® µð·ºÅ丮³ª ȤÀº ¾î¶² ´Ù¸¥ µð·ºÅ丮¸¦ ¶§¶§·Î À©µµ ¹Ú½º·Î ÀÌ¿ëµÇ±âµµ ÇÏ´Â ÄÄÇ»ÅÍ¿Í °øÀ¯Çϱ⸦ ¿øÇÑ´Ù¸é ±×¶§´Â ``security=USER'' ¸ðµå¿¡ ÀÇÇØ º¸¾ÈÀÌ ÀÔÁõµÇ´Â »ï¹Ù(samba)¸¦ ÀÌ¿ëÇϱ⠹ٶõ´Ù. ´ç½ÅÀÇ ³×Æ®¿÷¿¡ Çãºê·Î ÄÄÇ»Å͸¦ ¿¬°áÇÏ´Â °Í º¸´Ù´Â ½ºÀ§Ä¡ ¶ó¿ìÅ͸¦ ÀÌ¿ëÇÏ´Â °Íµµ ¾à°£ÀÇ Àå³°ú ¾ÇÀÇ·Î À©µµ°¡ ±ò·Á ÀÖ´Â ÄÄÇ»Å͸¦ »ç¿ëÇÏ´Â »ç¶÷µéÀ» ´ëºñÇÏ´Â µ¥ µµ¿òÀÌ µÉ °ÍÀÌ´Ù. ¾î·°Ç ³×Æ®¿öÅ© »óÀ¸·Î °øÀ¯µÇ´Â ¾î¶² µð½ºÅ©ÀÇ º¸¾ÈÀ» À¯ÁöÇÏ´Â °ÍÀº ¾ÆÁÖ ¾î·Á¿î ÀÏÀ̶ó´Â °Í¸¸ ¸í½ÉÇ϶ó.
±×·±µ¥µµ Á¤¸»·Î ³×Æ®¿÷¿¡ ¿¬°áµÈ µð½ºÅ©ÀÇ º¸¾ÈÀ» öÀúÈ÷ ÇÏ°í ½ÍÀº°¡? ´ëºÎºÐ È®½ÇÇÑ ¹æ¾î¹ýÀº À̽´°¡ µÈ´Ù. ¸¸¾à ´ç½ÅÀÌ ±â¹ÐÀÌ ÀûÈù ¼·ù¸¦ Ã¥»ó À§¿¡ µÎ°í ³ª°¬À» ¶§ ´©±º°¡°¡ »ç¹«½Ç¿¡ µé¾î°¡ ±× ±â¹ÐÀ» º¸¾Ò´Ù°í ÇÏÀÚ. ±×´Â Áï½Ã ±×°ÍÀÌ ¾î´À Á¤µµÀÇ °¡Ä¡°¡ Àִ°ÍÀÎÁö¸¦ »ý°¢ÇÏ°í´Â ±×°ÍÀÌ Á¤¸» ±âÄ¡ ÀÖ´Â °ÍÀ̶ó¸é Àΰ£ º»¼ºÀÇ ¾îµÎ¿î ºÎºÐ¿¡ µû¶ó Ã¥»ó¿¡ ¾É¾Æ ±×°ÍÀ» ÀÐÀ» °ÍÀÌ´Ù. ¸¸¾à ±× ¼·ù°¡ ÆÄÀÏ Ä³ºñ´ÖÀ̳ª Ã¥»ó ¼¶ø ¼Ó¿¡ µé¾î ÀÖ¾ú´Ù¸é ±×°ÍÀº ºÐ¸íÈ÷ ´õ ¾î·Á¿î ÀÏÀ̾úÀ» °ÍÀÌ´Ù. ¾î¶² ´Ü¼øÇÑ ³×Æ®¿÷¿¡¼ÀÇ º¸¾ÈÀÇ ¸ñÀûÀº ´©±¸µµ ¿ì¿¬È÷ ±× º¸¾ÈÀ» ±ú°Ô ÇÏÁö ¾Ê´Â °Í¿¡ ÀÖ´Ù Çصµ °ú¾ðÀÌ ¾Æ´Ï´Ù.