Banshee
Banshee

Reputation: 15807

Hosting ASP.NET in IIS7 gives Access is denied?

I have setup a application in my IIS7 that uses .NET Framework 4.0 (runned by NetworkService) but when browsing the site I get this:

Access is denied.
Description: An error occurred while accessing the resources required to serve this request. You might not have permission to view the requested resources.
Error message 401.3: You do not have permission to view this directory or page using the credentials you supplied (access denied due to Access Control Lists). Ask the Web server's administrator to give you access to*

I have tried to give NetworkService full permission on the folder that holds the website (the one that the web application in IIS is pointing against) but I do still get the access denied?

Why?

Upvotes: 143

Views: 276245

Answers (19)

iifast2
iifast2

Reputation: 334

After watching this tutorial :

https://www.youtube.com/watch?v=RbrZbHpXBTE&list=PLp1Emx1rT4z9YWLDXBjUwBb130qv2Zq2x&index=4&ab_channel=LearningProgrammingTutorial

I had the same problem using RDP ( windows server 2016 Datacenter ) i followed the tutorial above & enbaled my directory browsing options from the IIS internet infromation services manager.

error screenshot

what you want to do is to access your IIS manager , you can check out the tutorial above to learn how to access IIS manager if you have trouble acessing there , it was useful for me that's why I'm sharing then ... go to :

go to authentication

you should gave access to IUSER

you should gave access to IUSER ( or application tool identity , depends or what you want to work with ) and your problem would be solved! :)

Also you need to check your firewall and TCP settings , if ping between two machines didn't work for you , you can check this out : https://operavps.com/rdp-connection-issues/

Upvotes: 1

Haukland
Haukland

Reputation: 755

I was facing this issue after pulling from remote master and adding to the appsettings on web.config. I solved it by enabling Windows Authentication:

Click on the project and press f4

Make sure Windows Auth is enabled:

enter image description here

Upvotes: 0

Pradyumn Agrawal
Pradyumn Agrawal

Reputation: 1

I was also facing the same issue, Everything was normal all the rights were given to the user and for folder as well. After many research i found that the wwwroot (Source code folder) was shared with some other user. I stopped sharing and it worked like a charm.

Upvotes: 0

marsze
marsze

Reputation: 17055

After some thinking and a lot of of trial and error I found out that this error occurred because part of my web.config was encrypted and for some reason the key was no longer valid.

Re-encrypting the config section solved the issue.

Upvotes: 2

ADARSH BIDARI
ADARSH BIDARI

Reputation: 29

Checking the Application Pool Identity in Anonymous Authentication and enabling Forms Authentication would solve problem for access denied error. 😁

Upvotes: 2

Andreas Schneider
Andreas Schneider

Reputation: 601

In my case running c:\windows\Microsoft.Net\Framework64\v4.0.30319\aspnet_regiis.exe /i resolved the 403 access denied issue.

Upvotes: 2

toha
toha

Reputation: 5510

This is what happened to me:

Get - Post is ok. Working well.

When I try to use Options verb, the server return error like that.

403

Then, beware with urlScan

I add OPTIONS verb to urlscan configuration .ini file, then everything works well.

To check if urlscan is installed or not, open your iis manager, and open ISAPI FILTERS url scan should appear at the list.

Upvotes: 0

visokoo
visokoo

Reputation: 83

If the IUSR user is already specified in Authentication and you're still getting this issue, it could be that your Directory Listing isn't enabled. Be sure to check that. That was the case for me.

Upvotes: 0

midoriha_senpai
midoriha_senpai

Reputation: 187

Tried most of the solutions here, but no luck. What worked for me was adding "Everyone" to the security permissions. Properties -> Security -> Edit -> Add -> Everyone. The given defaults were enough for me to regain access.

In the near future, I should probably figure out what credentials are being sent to the server so that I can give proper permissions. But I hope it helps someone!

Upvotes: 5

Duane Boudreau
Duane Boudreau

Reputation: 130

I went round and round on this and it turned out to be improperly set default page. Hope this helps someone else avoid an hour of wasted time.

Upvotes: 2

ssis_ssiSucks
ssis_ssiSucks

Reputation: 1506

If you're using Anonymous Authentication, IIS 7 will use the "IUSR" account for directory access (unless you've set it to use the app pool identity. If you haven't granted IUSR sufficient permissions on your site's folders and files, you'll get this error

Upvotes: 5

Volkan
Volkan

Reputation: 686

OS : Windows 7 & IIS 7

If you still have permission denied after adding IUSR & NETWORK SERVICE. Add also IIS_WPG. The addition of this last user solved my problem.

For people who can't find those users: when you're trying to add a user in security of the folder (properties of the folder), click on "Advanced" of the window "Select Users or Groups". Change the location to the computer name then click on "Find Now". You'll find those users in the list below.

Upvotes: 5

Raj Pandey
Raj Pandey

Reputation: 21

We need to create a new user ComputerName\IUSR by going to the website folder-->Properties--->Security--->Edit-->Add and give read access. This would work definitely.

This solution is for IIS7

Upvotes: 2

Vitalii
Vitalii

Reputation: 11071

For me in windows 7 it started to work only after I gave 'Read & execute', 'List folder contents', 'Read' permissions to site folder for both users

  • IUSR
  • NETWORK SERVICE

IUSR permissions NETWORK SERVICE permissions

Upvotes: 5

Enkosi X
Enkosi X

Reputation: 403

I had the same problem, I enabled "Anonymous Authentication" but it still did not work. So I also ENABLED "Forms Authentication" Then it worked without any problems.

Upvotes: 14

Madhu S Reddy
Madhu S Reddy

Reputation: 11

It was due to WWWRoot directory security issue.

Simple solution is, Just copy applicatio folder to some other drive, Instead of "C:\Inetpub\wwwroot" and then create a virtual directory for this new path. That's it.

Upvotes: 0

Graham Laight
Graham Laight

Reputation: 4840

For me, nothing worked except the following, which solved the problem: open IIS, select the site, open Authentication (in the IIS section), right click Anonymous Authentication and select Edit, select Application Pool Identity.

Upvotes: 191

Banshee
Banshee

Reputation: 15807

I gave access to "IIS_IUser" but instead it should be "IUSR". That solved the problem.

Upvotes: 309

Matt
Matt

Reputation: 26971

In the Authentication settings for APP itself (IN IIS), see if you have anonymous enabled.

Upvotes: 2

Related Questions