´ÙÀ½ ÀÌÀü Â÷·Ê

2. SAMBA ¿¡¼­ REMOTE-PC ÃøÀÇ ÇÁ¸°ÅÍ ¼¼Æà °ü·Ã

PCÃø¿¡ ¿¬°áµÈ ¸®¸ðÆ® ÇÁ¸°Å͸¦ LINUXÀÇ SAMBA ¿¡¼­ Á¢±ÙÇÏ´Â ¹æ¹ýÀº Á¶±Ý ´Ù¸£´Ù. ÀÌ°ÍÀº LINUXÀÇ printcap¿¡ ÀÖ´Â ÇÊÅ͸¦ ÀÌ¿ëÇÏ´Â °ÍÀ¸·Î »ý¼ºµÈ ÇÁ¸°Æ®ÆÄÀÏÀ» ´Ù½Ã ÇÁ¸°ÅÍ°¡ ¿¬°áµÈ PC·Î Àü¼ÛÇÑ´Ù.

       PC Client   -> Sambar Server ----> lpr ------------> smbprint -----> PC ----> Printer

       (PCÁ¶ÀýÆÇ)     (/etc/smb.conf)         (/etc/printcap)       .config              (ÇÁ¸°Åͼ­¹ö)

¡¡ µû¶ó¼­ lpr ¸í·É½Ã¿¡ ÂüÁ¶ÇÏ´Â printcap ÆÄÀÏ¿¡ ÇÊÅ͸¦ ÁöÁ¤ÇÏ´Â if ¿É¼Ç¿¡ smbprint¸¦ ¼öÇàÇϵµ·Ï ÁöÁ¤ÇÏ°í ÀÖÀ¸¸ç smbprint´Â smbclient¸¦ È£ÃâÇÏ¿© PC¿¡ ÆÄÀÏÀ» Àü¼ÛÇÑ´Ù. À̶§ PC¼­¹ö¿¡ Á¢¼ÓÇÒ¼ö ÀÖ´Â ±ÇÇÑÀ» ¾ò±â À§ÇÏ¿© .config ÆÄÀÏ¿¡ ¼­¹ö¸í, ¼­ºñ½º¸í ¹× ºñ¹Ð¹øÈ£ ±â·ÏÇØ ³õ¾Æ¼­ smbclient°¡ ÇØ´çÁ¤º¸¸¦ ȹµæÇÒ ¼ö ÀÖµµ·Ï ÇÑ´Ù.

       lp|lj|HP LJ6P:\
              :lp=/dev/null:\
              :sd=/var/spool/lpd/lj:\
              :mx#0:sh:sf:\ :if=/usr/bin/smbprint:
              :af=/var/spool/lpd/lp/acct:

À̶§ LINUX¿¡´Â ÇÁ¸°ÅÍ°¡ ¿¬°áµÈ °ÍÀÌ ¾Æ´Ï¹Ç·Î lp ´Â null µð¹ÙÀ̽º¸¦ ÁöÁ¤ÇÑ´Ù. if °¡ ÇÊÅͷμ­ smbprint´Â script ÆÄÀÏÀÌ´Ù. ±×ÆÄÀÏÀÇ ³»ºÎ¿¡ ¼­¹ö ¹× ¼­ºñ½º, ºñ¹Ð¹øÈ£¸¦ ¾òÀºÈÄ smbclient¸¦ ¼öÇàÇÏ´Â script°¡ Æ÷ÇԵǾî ÀÖ´Ù.


   -- ¾Õ¿¡´Â »ý·« ---

   eval `cat $config_file`
   #
   # Some debugging help, change the >> to > if you want to same space.
   #
   echo "server $server, service $service" >> $logfile

   (
   # NOTE You may wish to add the line `echo translate' if you want automatic
   # CR/LF translation when printing.
   # echo translate
   echo "print -"
   cat
   ) | /usr/bin/smbclient "\\\\$server\\$service" $password -U $server -N -P >> $lo
   gfile

$config ÆÄÀÏÀº º¸Åë spool µð·ºÅ丮¿¡ .config ÆÄÀÏ·Î Á¸ÀçÇÑ´Ù. (»ý·«µÈ ºÎºÐ È®ÀÎ) .configÀÇ ³»¿ëÀº

       server=PC_SERVER
       service=PR_SHARENAME
       password="password"

¿Í °°Àº ASCII ÆÄÀÏ·Î »ý¼ºÇÑ´Ù. password ´Â ²À "(´õºí Äí¿ÀÅ×À̼Ç)·Î ¿­°í ´Ý¾Æ¾ß ÇÏ¸ç ºñ¹Ð¹øÈ® ¾øÀ» ½Ã¿¡´Â "" ·Î Ç¥ÇöÇÑ´Ù. À̺κп¡¼­ ÆÄÀÏÀÌ Á¦´ë·Î Àü¼ÛµÇÁö ¾ÊÀ» ½Ã¿¡´Â spool ÆÄÀÏ¿¡ »ý¼ºµÈ ÆÄÀÏÀ» Á÷Á¢ smbclient¸¦ ½ÇÇà½ÃÄÑ PC¿¡¼­ ÀμâµÇ´ÂÁö È®ÀÎÇØ º»´Ù.

       # smbclient '\\mimas\lj' <passwd> -U mimas -N -P

ÀÌ¿Í °°ÀÌ Çؼ­ ÀμⰡ µÈ´Ù¸é À§¿¡¼­ ±â¼úÇÑ ¿¬°á°ü°è°¡ ¿øÇÒÇÏÁö ¾ÊÀº ¿øÀÎÀ¸·Î smbclient°¡ ½ÇÇàµÇÁö ¾Ê´Â°ÍÀ̹ǷΠLOG ÆÄÀϵîÀ» Â÷±ÙÂ÷±ÙÈ÷ »ìÆ캸µµ·Ï ÇÑ´Ù. ÀμⰡ µÇÁö ¾Ê´Â´Ù¸é ÇÁ¸°ÅÍ°¡ ¿¬°áµÈ PC¼­¹ö¿¡ ¹®Á¦°¡ Àִ°ÍÀ¸·Î ÃßÁ¤ÇÒ ¼ö ÀÖÀ¸¹Ç·Î ÇØ´ç PC¼­¹ö¿¡¼­ ÇÁ¸°ÅÍÀÇ ¿¬°á°ü°è¸¦ È®ÀÎÇØ º¸µµ·Ï ÇÑ´Ù. ¡¡


´ÙÀ½ ÀÌÀü Â÷·Ê