天天看點

cmd中配置IIS支援Kerberos 和 NTLM 協定

通過內建Windows驗證(Integrated Windows authentication)驗證客戶請求時IIS傳遞Negotiate安全頭(security header).Negotiate 安全頭讓客戶選擇Kerberos驗證還是NTLM驗證.除了以下情形外Negotiate過程一般都選擇Kerberos驗證:

1.參與驗證的一方系統不能使用Kerberos驗證;

2.調用順序不能提供足夠的資訊以使用Kerberos驗證

要使Negotiate過程選擇Kerberos驗證客戶順序必須提供SPN(service principal name),UPN(user principal name)或NetBIOS帳号.否則Negotiate過程将優先使用NTLM協定.

IIS7.0

檢視NTAuthenticationProviders:

c:\windows\system32\inetsrv\appcmd list config /section:windowsAuthentication

設定NTAuthenticationProviders:

c:\windows\system32\inetsrv\appcmd clear config /section:windowsAuthentication

c:\windows\system32\inetsrv\appcmd set config /section:windowsAuthentication -+providers.[value='Negotiate']

c:\windows\system32\inetsrv\appcmd set config /section:windowsAuthentication -+providers.[value='NTLM']

使用Appcmd.exe在IIS7.0中禁用Windows驗證

1.cd %SystemRoot%\System32\inetsrv

2.更改設定:

appcmd.exe set config /section:windowsAuthentication /enabled:false

3.檢視更改後的設定:

appcmd list config /section:windowsAuthentication

IIS6.0:

cscript adsutil.vbs get w3svc/WebSite/root/NTAuthenticationProviders

cscript adsutil.vbs set w3svc/WebSite/root/NTAuthenticationProviders "NegotiateNTLM"

IIS5.0或5.1

cscript adsutil.vbs get w3svc/NTAuthenticationProviders

cscript adsutil.vbs set w3svc/NTAuthenticationProviders "NegotiateNTLM"

本文轉自 拾瓦興閣 51CTO部落格,原文連結:http://blog.51cto.com/ponyjia/1089354

繼續閱讀