Linux ã§åã KDC ã« Windows ã¯ã©ã¤ã¢ã³ããèªè¨¼
UNIX ç³» OS ã§æ§ç¯ããã Kerberos ã®ç°å¢ã«ãWindows ã¯ã©ã¤ã¢ã³ããå ãã話ã¯ãWindows 2000 㧠Active Directory ãç»å ´ããããã«ã¯ãã¨ããã©ããã§èããã¨ãããã¾ãããæåãªã®ã¯ãmonyo ãã¨ãããã¯ããã¨ã®ã¶ããã®æ¸ããè¨äºã§ãããã
Linux の認証を Active Directory で行なう方法
Windows 2000 マシンの認証を Linux 上の Kerberos サーバで行なう方法
ãã ãå½æã¯èªè¨¼ã§ãã¦ããèå¿ã®ã¢ããªã±ã¼ã·ã§ã³ã§å¯¾å¿ãã¦ããç©ãå°ãªããããããªé¢¨ã«ããããèªè¨¼éãããã¨ãã£ãæãã§ããã
ãããããµã¨æ°ãã¤ãã¨ãHTTP ããIMAPãPOP3ãSMTP ã¨ãã£ãã¡ã¸ã£ã¼ãªãããã³ã«ã§ Kerberos ãçãããç°å¢ãå¢ãã¦ãã¦ãå®éã« Kerberos èªè¨¼ããµãã¼ãããã½ããããç¹ã«æµ·å¤çºç¥¥ã®ãã«ã OS 対å¿ã½ãããä¸å¿ã«å¢ãã¦ããã®ã§ãä»ã ã£ãããã·ã³ã°ã«ãµã¤ã³ãªã³ç°å¢ã®è¯ããå®æåºæ¥ãã®ã§ã¯ãã¨æã£ã¦è©¦ãã¾ããã
Windows ã§ã® Kerberos 対å¿
Windows ã¯ã©ã¤ã¢ã³ãã Kerberos ã«å¯¾å¿ãããæ¹æ³ã¨ãã¦ãä¸è¨ã®ï¼ã¤ããã¾ãã
- Windows ã«å ã åãã£ã¦ããæ©æ§ã使ãã
- MIT Kerberos for Windows ãã¤ã³ã¹ãã¼ã«ããã
åè ã¯ã究極çã«ã¯ Active Directory ãæ§ç¯ããåå ããæ¹æ³ã§ããå¾è ã¯ãKerberos çºç¥¥ã®ããµãã¥ã¼ã»ããå·¥ç§å¤§å¦ï¼MITï¼ããªãªã¼ã¹ãã¦ãããã®ã§ãã
ããããéæã¡ãªã Windows Server ãè²·ã£ã¦ãã¦ãActive Directory ãæ§ç¯ããã°ãåèã«ãªãè³æãããããããããç°¡åã§ãããéãç¡ããã©æéã¨ç¥èããããªããã¾ã ã¢ã«ãã¡çæ±ãã§ãããSamba Ver.4 ã使ãã¨ãActive Directory ç°å¢ã¯æ§ç¯ã§ãã¾ãã
ãã ãActive Directory ç°å¢ã¯ãåãªãã·ã³ã°ã«ãµã¤ã³ãªã³ã§ã¯ããã¾ãããä¸çªå¤§ãããã¤ã³ãã¯ãåã¯ã©ã¤ã¢ã³ãã®å種è¨å®çãã·ã¹ãã 管çè ãå¼·å¶ã§ãããã°ã«ã¼ãããªã·ã¼ã®ä»çµã§ããActive Directory ã«åå ããã« PC ã使ã£ã¦ãã¦ãå¾ãã Active Directory ã«åå ããã¨ãããã¾ã§ã¨åãã¦ã¼ã¶åã§ãã£ã¦ããå ¨ãå¥ã¦ã¼ã¶æ±ãã«ãªããã¨ã«æ¸æã人ã¯å°ãªããªãã¨æãã¾ããActive Directory ã«ããã·ã³ã°ã«ãµã¤ã³ãªã³ã®å©ä¾¿æ§ãå¾ããªãããã® Active Directory ã管çããè ã«å¾ãå¿ è¦ãããã¾ãã
å ã ã® Kerberos ã«ã¯ãActive Directory ã®ãããªãå¼·åãªããªã·ã¼é©ç¨ã®ä»çµã¯ããã¾ãã*1ãã·ã³ã°ã«ãµã¤ã³ãªã³ã ãã®äºãèããã¨ãã¡ãã£ã¨å¤§ãããªæããããã¾ããã§ãç´ç²ã« Kerberos ã®ã·ã³ã°ã«ãµã¤ã³ãªã³ãå©ç¨ããä»çµãç¨æããã¦ãã¾ãããã®ä»çµã«é¢ãã¦ã¯ãå¾è¿°ãã¾ãã
MIT Kerberos for Windowsï¼ä»¥ä¸ãKfWï¼ã¯ãUNIX ç³» OS ã§ä½¿ããã Kerberos ã®ä½¿ãæ¹ããWindows ã§ä½¿ããããã«ãããã®ã§ãå®éã«è©¦ãã¦ã¿ãã¨ãåè ã®ãWindows ã«å ã åãã£ã¦ããæ©æ§ãã使ãããæ軽ã«å©ç¨ã§ãã¾ããä½ããæ¥æ¬èªçã¯ããã¾ãã...ã
ksetup vs KfW
Windows ãã¤ãã£ãã® Kerberos 対å¿ã®è¨å®ã«ä½¿ã ksetup ã¨ããã³ãã³ããããã¾ããWindows ã®ç¨®é¡ããµã¼ãã¹ããã¯ã®ç¶æ³çã§ãæåããå ¥ã£ã¦ããå ´åããSupport Pack ãã¤ã³ã¹ãã¼ã«ããªãããããªãå ´åãããã¾ããããã®ã³ãã³ãã使ã£ã¦ãActive Directory ãããªã Kerberos ç°å¢ãå©ç¨ã§ããããã«ãªãã¾ãã
ã¨ãããããã® ksetup ã使ã£ãå ´å㨠KfW ã使ã£ãå ´åã§ãKDC ã®è¨å®ã»ç®¡çæ¹æ³ãåã³ã対å¿ã¢ããªã±ã¼ã·ã§ã³ã«éããããã¾ãã
ã¢ããªã±ã¼ã·ã§ã³å´ã®é½å
対å¿ã¢ããªã±ã¼ã·ã§ã³ã§ã®éãã¯ã端çã«å¯¾å¿ã¢ããªã±ã¼ã·ã§ã³ã使ã API ã®éãã«ãªãã¾ããWindows ãã¤ãã£ãã®å ´å㯠SSPI ã¨ãã API ã使ãäºã«ãªãã¾ããä¸æ¹ãKfW ã®å ´åã«ã¯ãKfW ã«ä»å±ããã©ã¤ãã©ãªãå©ç¨ããäºã«ãªãã¾ããã¤ã¾ããã¢ããªã±ã¼ã·ã§ã³ããã©ã£ã¡ã«å¯¾å¿ãã¦ããããããã¤ã³ãã«ãªãã¾ããUNIX ç³» OS åããçºç¥¥ã ã£ããããå ´åã«ã¯ãKfW ã® API ã使ãã»ããå®è£ ããããããã¡ã³ããã³ã¹ãããããäºã«ãªãã¾ãã
ããããå ã Windows åãã®ã¢ããªã±ã¼ã·ã§ã³ã ã¨ãKfW ãã¤ã³ã¹ãã¼ã«ããã¦ããªãã¨ä½¿ããªãã©ã¤ãã©ãªããã¦ã«ããããããWindows ã«æåããç¨æããã¦ãã API ã使ãæ¹ãè¯ããã¨ããäºã«ãªãã¾ããã¾ããKfW ã使ãã¨ãWindows ã¸ã®ãã°ãªã³å¾ã«ãæ¹ã㦠KfW ã使ã£ã¦ Kerberos ã§ã®èªè¨¼ãåããå¿ è¦ãããã¾ã*2ã
ãµã¼ãå´ã®é½å
KDC ã UNIX ç³» OS ã§ä½ã£ã¦ãUNIX ç³» OS é㧠Kerberos èªè¨¼ã使ã£ã¦ããã¨ãKfW ã®æ¹ããUNIX ç³» OS åãã¨åãæè¦ã§éç¨ã§ãã¾ããå ã ãUNIX ç³» OS ã®å ´åãOS ã¸ã®ãã°ã¤ã³ã¨ã¯å¥ã«ãkinitãkdestory ã¨ããã³ãã³ãã§ãKerberos ã¸ã®ãã°ã¤ã³ããã°ã¢ã¦ã*3ãå¯è½ã§ã*4ããªã®ã§ããKerberos ã使ããï¼ãã¨ããå®æãæã£åãæ©ãå¾ãã«ã¯ KfW ã®æ¹ã便å©ã§ããç§ãæåã«è©¦ããã®ã¯ putty ã§ããã¹ã¯ã¼ãããã¹ãã¬ã¼ãºã®å ¥åãªãã«ãã°ã¤ã³ã§ããæã®æåã¯å¿ãããã¾ãããThunderbird ãè¨å®ã¨ãã£ã¿ãã Network.auth.use-sspi ã false ã«ãã¦ããã¨ãKfW ã使ãäºãå¯è½ã§ãã
ãã以ä¸ã«å¤§ããã®ããWindows ãã¤ãã£ãã®èªè¨¼ãå¯è½ã«ããããã®æ¡ä»¶ã§ãããããããã° Linux ã® KDC ã« ksetup ã使ã£ã¦èªè¨¼ã§ããããã«ãªã£ãããã¨ããè¨äºã¯å¤ãã®ã§ããããã®æé ã®ä¸ã®ã©ããå¿ é ã§ãããããªãã·ã§ã³ãªã®ããã¯ã£ããã¨æ¸ããã¦ããè¨äºãè¦ã¤ããäºãåºæ¥ã¾ããã§ããã
ã¨ãããã¨ã§ãå®éã«ãããã試ãã¦ã¿ã¾ããã
Windows ãã¤ãã£ã㧠Kerberos ã«å¯¾å¿ãããããã®æ¡ä»¶
ãã¹ãããªã³ã·ãã«ã¨åå解決
ããªã³ã·ãã«ãã¨ããè¨è㯠Kerberos ç¹æã§ãããActive Directory ã®ãªãã¸ã§ã¯ãã«è¿ãããããã¾ãããKerberos ã®èªè¨¼ã®å¯¾è±¡ã¨ãªãç©å ¨è¬ãæãè¨èã§ãã¦ã¼ã¶ã ã£ãããã³ã³ãã¥ã¼ã¿ã ã£ããããµã¼ãã¹ã ã£ãããã¾ãã
KfW ã使ãå ´åãã¯ã©ã¤ã¢ã³ã PC ã®æ å ±ã Kerberos å´ã«æãããå¿ è¦ã¯ããã¾ãããåºæ¬çã«ã¯ãã¦ã¼ã¶ã®ããªã³ã·ãã«ã¨ãå®éã«ä½¿ããã¨ãã¦ãããµã¼ãã¹ã®ããªã³ã·ãã«ãããã° OK ã§ãã
ã¨ããããWindows ãã¤ãã£ãã®å ´åãããããããã®ã¦ã¼ã¶ããã® PC ã使ã£ã¦è¯ãã®ããåããã¾ããå®éã« KDC ãåãåºããã°ãè¦ã¦ããã¨ãèªè¨¼è¦æ±ã®å¾ã«å¿ ããã¯ã©ã¤ã¢ã³ã PC ã®ãã¹ãããªã³ã·ãã«ã«å¯¾ãããã±ããè¦æ±ãããã®ãåããã¾ããKfW ã®å ´åãWindows ã¸ã®ãã°ãªã³ãçµãã£ããã¨ã« Kerberos ã®èªè¨¼ãåããã®ã§ãããã®ã¦ã¼ã¶ããã® PC ã使ã£ã¦è¯ãã®ããã¯åããã¾ãããUNIX ç³» OS ãã¯ã©ã¤ã¢ã³ãã¨ãã¦ä½¿ãå ´åãåæ§ã§ãã
ãã®ãããã¯ã©ã¤ã¢ã³ã PC ã«å¯¾ãããã¹ãããªã³ã·ãã«ã KDC ã«ç»é²ããã¦ããå¿ è¦ãããã¾ããã§ãæ£å¼ã«ã¯ããã¹ãããªã³ã·ãã«åã«å«ã¾ãã FQDN ãã¦ãã¼ã¯ã§ããäºãä¿è¨¼ããããã«ãDynamic DNS ã§ã使ã£ã¦ããã®ãè¯ãã®ã ã¨æãã¾ãããFQDN ããã¡ãã¨åå解決ã§ããå¿ è¦ã¯ç¡ãããã§ããä½ããWindows å´ã®ããã«ã³ã³ãã¥ã¼ã¿åããããã¹ãããªã³ã·ãã«åã決ã¾ãã®ã§ããã®ããã«ã³ã³ãã¥ã¼ã¿åãã¨ãKDC ã«ç»é²ããã¦ãããã¹ãããªã³ã·ãã«ã® FQDN ãåè´ãã¦ããå¿ è¦ã¯ããã¾ãã
æå·
ãã±ããã®æå·åã«ä½¿ããæå·æ¹å¼ã«éããããã¾ããWindows 2000 ãç»å ´ããå½åã¯ãã¢ã¡ãªã«ã®æå·è¼¸åºè¦å¶ã®å½±é¿ãªã©ããã£ã¦ãRC4 ã使ããã¾ããããXP ã§ã¯ DES ããVista 以éã§ã¯ AES ã使ããããã§ã*5ã
ã§ããã®å¯¾å¿ãã¦ããæå·æ¹å¼ã®é¢ä¿ã§ãKDC ã«ä¿åãããéµããã©ã®æå·æ¹å¼ã®éµããåé¡ã«ãªãã¾ãã
/etc/krb5.conf ã®è¨å®ã§ãããã©ã«ãã®æå·æ¹å¼ãå¤æ´ãããã¨æ¸ããã¦ããè¨äºã¯å¤ãã®ã§ãããèã¯ããããããªã³ã·ãã«ã®éµãã©ã®å½¢å¼ããã§ãã
ããªã³ã·ãã«ä½ææããããã¯ããã¹ã¯ã¼ãå¤æ´æã«ã-eããªãã·ã§ã³ã使ãã¨ãä½æããéµã®ç¨®é¡ãæå®ã§ãã¾ãã
kadmin.local: addprinc -e des-cbc-crc:normal test NOTICE: no policy specified for [email protected]; assigning "default" Enter password for principal "[email protected]": Re-enter password for principal "[email protected]": Principal "[email protected]" created.
確èªãã¦ã¿ãã¨ãä¸è¨ã®ããã«ãªãã¾ãã
kadmin.local: getprinc test Principal: [email protected] Expiration date: [never] Last password change: Thu Aug 04 14:58:09 JST 2011 Password expiration date: Tue Jan 31 14:58:09 JST 2012 Maximum ticket life: 1 day 00:00:00 Maximum renewable life: 0 days 00:00:00 Last modified: Thu Aug 04 14:58:09 JST 2011 (root/[email protected]) Last successful authentication: [never] Last failed authentication: [never] Failed password attempts: 0 Number of keys: 1 Key: vno 1, DES cbc mode with CRC-32, no salt Attributes: Policy: default
ã§ãããã§ä½ã£ãéµã¨åãç©ã使ããããã«ãWindows å´ã§ãksetup /setcomputerpassword ãããå®è¡ãã訳ã§ããããã®æã«ä¿åãããç©ãä½ããã¨ããäºãã¯ã£ãããã¾ãããã©ããããå°ãªãã¨ã XP ã§ã¯ des-cbc-crc ã使ããããã§ããCentOS 5.6 ä¸ã§ãæ®éã«ãã¹ãããªã³ã·ãã«ããã¹ã¯ã¼ãæå®ã§ä½ãã¨ãããã©ã«ãã§ä½ãããéµã¯ä»¥ä¸ã®ããã«ãªãã¾ãã
- Triple DES cbc mode with HMAC/sha1, no salt
- ArcFour with HMAC/md5, no salt
- DES with HMAC/sha1, no salt
- DES cbc mode with RSA-MD5, no salt
- DES cbc mode with CRC-32, Version 4
- DES cbc mode with CRC-32, AFS version 3
des-cbc-crc ã«è©²å½ããããªãã®ãæå¾ã®ï¼ã¤ã§ãããããããå¾ãã«ãVersion 4ãã¨ãAFS version 3ãã¨ããã®ãä»ãã¦ãã¾ããä¸æ¹ãå ã«ã-e des-cbc-crc:normalãã¨ãã¦éµãä½ã£ãæã¯ããno saltãã«ãªã£ã¦ã¾ãã
ãã®ãnormalãã®é¨åã¯ãéµãçæããéã«ããã¹ã¯ã¼ãæååã«ä»ããã½ã«ãã®ç¨®é¡ãããããnormalãã¯ãdefault for Kerberos 5ã㨠Kerberos V5 System Administratorâs Guide*6 ã«æ¸ããã¦ãã¾ããã§ããã®ãdefault for Kerberos 5ãããno saltããããã
ã¨ãããã¨ã§ãWindows ã¯ã©ã¤ã¢ã³ãã«å¯¾ãããã¹ãããªã³ã·ãã«ãä½æããå ´åãã¯ã©ã¤ã¢ã³ãã XP ã§ããã°ããdes-cbc-crc:normalãã§éµãä½ãå¿ è¦ãããããã§ããVista 以éã®å ´åã¯ããaes128-ctc:normalãã¨ãã«ãªããããªæ°ããã¾ããããã¤ãã確èªãã¦ã¿ããã¨æãã¾ãã
æå·æ¹å¼ã§åé¡ã«ãªãã®ã¯ããã®ãWindows ã¯ã©ã¤ã¢ã³ãã®ãã¹ãããªã³ã·ãã«ãã ãã§ãã¦ã¼ã¶ããµã¼ãã¹ã®ããªã³ã·ãã«ã«é¢ãã¦ã¯ãããã©ã«ãã®ã¾ã¾ã§å¤§ä¸å¤«ã§ãããä½ããåè¿°ã®ã½ã«ãã®é¢ä¿ã§ãçµæçã«ä½¿ããã®ã rc4-hmacï¼getprinc ã®è¡¨ç¤ºã§ãArcFour with HMAC/md5ãï¼ã«ãªã£ã¦ãã¾ãã¾ãã
ã¡ãªã¿ã«ãkadmin ã§éµãä½ãéã«ãã©ã®ç¨®é¡ã®éµãä½ããã¯ã/etc/krb5.conf ã® [realmsãã»ã¯ã·ã§ã³ã§ãsupported_enctypesãã«åè¨ããã¨å¤æ´ã§ãã¾ããããå¼·åãªæå·ã使ããããã«ããããã«ã¯ããããå¤æ´ãã¦ãWindows ããã使ããæå·ã«å¯¾ããéµããããã©ã«ãã§ãçæãããããã«ãã¦ããã®ãè¯ãããã§ãã
DNS ä¸ã§ã® SRV ã¬ã³ã¼ãã®ç»é²
DNS ä¸ã« Kerberos é¢ä¿ã® SRV ã¬ã³ã¼ãã追å ãããã¨ãã話ãããã¾ãããããã¯å¿ é ã§ã¯ããã¾ããã
ããããããksetup /AddKdc ããã¨ããæé ãè¦ãç¬éãSRV ã¬ã³ã¼ãã¯è¦ããªãã ãããªãã¨æãã¾ããããå®éã«è©¦ãã¦ãä¸è¦ãªäºã確èªãã¾ããããããããDNS å´ã« SRV ã¬ã³ã¼ããç¨æããã°ãksetup /AddKdc ããã®æé ã¯ä¸è¦ãªãã ããã¨æãã¾ããåæ§ã®äºã¯ããksetup /AddKpasswd ããã«ãè¨ããã¨æãã¾ãã
ããã«ãã¦ãããã£ã±ãé£ãã
ã¨ãããããèªåã試ããæåããæã®ãã¤ã³ããæ¸ãã ãã®ã¤ããããããã¶ãé·ãæç« ã«ãªãã¾ããã
èªåãã¾ã ãåãããªãäºã ããã§ãééã£ããã¨ãæ¸ãã¦ããå¯è½æ§å¤§ã§ããã§ããã·ã³ã°ã«ãµã¤ã³ãªã³ç°å¢ã®å¿«æã¯ãã¾ããªã(^^;
*1:Kerberos ãã®ãã®ã«ããªã·ã¼ã¨ããæ¦å¿µã¯ããã¾ããããã¹ã¯ã¼ãã®æå¹æéãé·ãã®è©±ã§ããã¹ã¯ãããç°å¢ãå¼·å¶ãããããªæ©è½ã§ã¯ããã¾ããã
*2:Windows ãã¤ãã£ãã§ã® Kerberos 対å¿ã®å ´åãKfW ã§ãèªåçã«ãã®èªè¨¼æ å ±ã使ããããã§ãããªã®ã§ãSSPI é対å¿ã® Kerberos 対å¿ã¢ããªã±ã¼ã·ã§ã³ãããå ´åãKfW ãå ¥ããã ãã§ããã®ã¢ããªã±ã¼ã·ã§ã³ã使ããããã«ãªãã¨æãã¾ãã
*3:TGT ã®åå¾ã¨ç ´æ£ãã¨ããã®ãæ£ããè¨ãæ¹ãã¾ããKerberos ã®ä»çµããèããã°ããã°ã¤ã³ããã°ã¢ã¦ãã¨ããè¨ãæ¹ãä¸é©åãªã®ã¯åãããã ãã©ããããæ·å± ã®é«ãåå ãããªãããªããã¨å人çã«ã¯æãã¾ã
*4:UNIX ç³» OS ã§ããpam 㨠Kerberos ãçµã¿åãããã¨ãOS ã¸ã®ãã°ã¤ã³ã¨åæã« Kerberos ã«é¢ãã¦ãæºåå®äºãã¨ããç¶æ ã«ã§ãã¾ãã
*5:Windows 7, Windows Server 2008 R2 ã§ã¯ãDES ãããã©ã«ãã§ã¯ç¡å¹ã«ãªã£ã¦ããããã§ãï¼Changes in Kerberos Authentication | Microsoft Docsï¼ã
*6:CentOS 5.6 ã ã¨ã/usr/share/doc/krb5-server/admin-guide.ps.gz ã«ããã¾ããPostscript ãã¡ã¤ã«ã gzip ã§å§ç¸®ãããã®ãªã®ã§ãå±éå¾ãps2pdf ã¨ã㧠PDF ã«ãã¦ããã¨è¯ãã§ãããã