开发者

Disable inheriting the "Allow all users" rule from IIS 7

开发者 https://www.devze.com 2023-04-03 14:19 出处:网络
I created a new site in IIS 7. This site is inheriting a rule to allow all users. I want to remove this rule but it w开发者_如何学Con\'t let me. Is there a way to set the site to not inherit any rules

I created a new site in IIS 7. This site is inheriting a rule to allow all users. I want to remove this rule but it w开发者_如何学Con't let me. Is there a way to set the site to not inherit any rules?


Change your web.config f.e. in the following way:

<system.web>
   <authorization>
      <allow roles="Administrator"/>
      <deny users="?"/>
   </authorization>
</system.web>

Anonymous users are identified with the questionmark.

http://msdn.microsoft.com/en-us/library/wce3kxhd.aspx

You can do the same in IIS, what actually changes your web.config in the above way.

Disable inheriting the "Allow all users" rule from IIS 7

Edit: If this does not work try this at the top of the web.config:

<configuration>
    <system.webServer>
        <security>
            <authorization>
                <remove users="*" roles="" verbs="" />
                <add accessType="Deny" users="?" />
                <add accessType="Allow" roles="Administrators" />
            </authorization>
        </security>
    </system.webServer>
</configuration>

http://www.iis.net/ConfigReference/system.webServer/security/authorization

Edit2: My last attempt ...

Change the permission on your application directory to not include inheritable permissions from it's parent.

Disable inheriting the "Allow all users" rule from IIS 7

Disable inheriting the "Allow all users" rule from IIS 7

Disable inheriting the "Allow all users" rule from IIS 7

Disable inheriting the "Allow all users" rule from IIS 7


The solution for this is to use URL Authorization. See here to install it. Then in IIS Authorization Rules you can remove the rule that allows all users to access the site.

Disable inheriting the "Allow all users" rule from IIS 7

Based on this previous question IIS7 Authorization Rules / Config - Prompting Perpetually

0

精彩评论

暂无评论...
验证码 换一张
取 消