【问题标题】:IIS Limit access to file + Basic AuthenticationIIS 限制对文件的访问 + 基本身份验证
【发布时间】:2016-02-22 15:46:12
【问题描述】:

我有一个使用 IIS 8.5 基本身份验证的简单内部站点。 在一个特定的 html 文件中,我想进一步限制某些用户/角色。

更新:这是我的 Web.config,我仍然可以使用我的 Windows (LDAP) 帐户在浏览器中访问 inhouse.html 文件。我想阻止所有用户访问它。然后只允许少数用户。

<?xml version="1.0"?>
<configuration>

<system.web>
  <compilation debug="true" targetFramework="4.6" />
  <httpRuntime targetFramework="4.6" />
  <authentication mode="Windows" />
</system.web>

<location path="inhouse.html">
   <system.web>
       <authorization>
          <remove users="*" roles="" verbs="" />

       </authorization>
   </system.web>
</location>

</configuration>

【问题讨论】:

    标签: security iis web-config iis-8.5


    【解决方案1】:

    试试这个:

    <location path="inhouse.html">
       <system.web>
           <authorization>
              <remove users="*" roles="" verbs="" />
              --add the users you want here.
           </authorization>
       </system.web>
    </location>
    

    取决于您的 web.config 的其余部分是否适用 system.webserver 或 system.web。

    【讨论】:

    • 我正在尝试这个。可以使用我的帐户访问,但这应该阻止所有?
    • 你需要一个 &lt;authentication mode="Windows" /&gt; 在那里(在 system.web 中)处于正确的模式。
    猜你喜欢
    • 1970-01-01
    • 2023-03-20
    • 2014-09-15
    • 2012-02-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-10
    • 1970-01-01
    相关资源
    最近更新 更多