限制文件访问在IIS特定用户 [英] Limit file access to specific users in IIS

查看:432
本文介绍了限制文件访问在IIS特定用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行在IIS 6.0(Windows 2003中)一个ASP.NET网站,该网站使用集成Windows身份验证。该IWA配置不是必须的(直到现在),但无论如何配置。该应用程序池中运行的网络服务。此外,在web.config中,有行。
我现在面临的问题是,有限制访问特定页面的新请求,所以,只有有限的用户数(在Active Directory中的单个组)能获得这些数据。

I'm running an ASP.NET web site on IIS 6.0 (Windows 2003), and the site uses "integrated windows authentication". The IWA configuration is not a must (until now), but is configured anyway. The application pool runs as the "Network Service". Also, in web.config, there's the line "". The problem I'm facing now is that there's a new request to limit access to a specific page, so that only a limited number of users (a single group in the active directory) could gain access to it.

我一直在试图改变该文件的NTFS权限,但是这并不工作,因为IIS使用网络服务来访问该文件,权限,无论休息。从ACL中删除网络服务(或用户组),将导致页面无法在所有的工作。

I've been trying to change NTFS permissions on that file, but this doesn't work, as IIS is using "Network Service" to access the file, regardless the rest of the permissions. Removing "Network Service" (or the "Users" group) from the ACL, would cause the page not to work at all.

所以,我怎么能限制访问特定页面,仅针对特定的用户?

So how can I limit access to a specific page, only for specific users?

推荐答案

您可以使用你的web.config以下内容:

You can use the following in your web.config:

<configuration>
   <location path="ProtectedPage.aspx">
      <system.web>
         <authorization>
            <allow users="SomeUser"/>
            <deny users="?"/>
         </authorization>
      </system.web>
   </location>
</configuration>

这篇关于限制文件访问在IIS特定用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆