Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบ >> Windows

ACCESS DENIED - Constrained Delegation สำหรับ CIFS ล้มเหลวใน Windows

ปัญหา: เข้าถึง Service ที่ใช้ Network Shares บน Middle-tier Server แล้วถูกขอ Credentials แล้วได้ ACCESS_DENIED

3 สถานการณ์ที่พบบ่อย

Scenario 1: IIS Website

  • Home Directory 指向 Remote Share (Pass-through Auth + Constrained Delegation for CIFS)
  • App Pool ใช้ Service Account
  • Domain Account Trusted for Delegation สำหรับ CIFS บน File Server

Scenario 2: Web App

  • Web App เข้าถึง File Server เป็น User
  • App Pool ใช้ Service Account + Trusted for Delegation CIFS
  • Constrained Delegation for CIFS กำหนดบน Service Account

Scenario 3: Server-side Application

  • Client เข้าถึง App > App เข้าถึง Remote Shares เป็น User
  • App รันภายใต้ Service Account
  • Service Account Trusted for Delegation + CIFS Delegation

Root Cause

ปัญหาระหว่าง MrxSmb 2.0 และ Kerberos เมื่อมี Constrained Delegation

2 Workarounds จาก Microsoft

Workaround 1 (แนะนำ): ใช้ Machine Account แทน Service Account

บน Domain Controller ของ Web Server:

  1. Active Directory Users and Computers > Computers Folder
  2. Right-click Web Server Computer > Properties > Delegation Tab
  3. ติ๊ก "Trust this computer for delegation to specified services only"
  4. เลือก "Use Kerberos only" > OK
  5. Add > Users or Computers > ใส่ชื่อ File Server > OK
  6. เลือก CIFS Service > OK

Workaround 2 (ไม่แนะนำ): ใช้ Service Account + Protocol Transition

ขั้นตอน 1 - Computer Account: เหมือน Workaround 1 แต่เลือก "Use any authentication protocol" (Protocol Transition)

ขั้นตอน 2 - Service Account: Users Folder > Service Account > Properties > Delegation > "Trust this computer for delegation to specified services only" > "Use Kerberos only" > Add File Server > CIFS Service

คำเตือน: Workaround 2 ต้องการ Protocol Transition ซึ่งลดความปลอดภัย