IIS_IUSRS Identity for a website - iis-7

I am using IIS7 to host an asp.net 2.0 site. However, whenever I browse it I get the error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Now I realize that this is because the IIS_IUSRS does not have access to the web.config. My question is how can I grant access to IIS_IUSRS
When I look under Application Pools and check the Identity. It shows
ApplicationPoolIdentity(default), LocalService, LocalUser and Network Service
However, I cannot seem to find IIS_IUSRS
Where do I find it

IIS_IUSRS is actually a Windows group so you won't find it under the application pools in IIS.
If you need to grant this group access, then this will need to be done via the file system, e.g. you could go to the folder where you have deployed your ASP.NET application and grant permissions to the group:

Related

ASP.NET Access Denied error when trying to write into Network Folder

I've a requirement of writing into a network folder from ASP.NET.
So I just used Streamwriter class and it works fine when trying from local system using Visual studio web server. But when trying to host it into IIS on the same machine writing into network folder not working at all.
It saying
Access to {\MYSERVER\specialfolder} is denied
So I thought it as some access issue. What I tried was as follows
Changed Default Applicaiton Pool (Which is the pool using for my
domain) identity to local system (And tried the other 4 ones too) :
Still the error
Authentication change for my site. Change from
Anonymous for specific user IUSR into Application pool Identity : No
help
Right clicked on my site and then selected edit permission, then
specified write permission for IIS_IUSRS group : Not worked
Also I tried, Right Click on the network folder itself -> security ->
But there is not IIS_IUSRS group
What else I'm missing for having the write permission into network
folder.
Details about my system
IIS 8.5
WINDOWS SERVER 2012R2
VISUAL STUDIO 2015
As far as I know, the IIS use the LOCAL user which generated by the IIS, this is local computer account.
If you want to access another network folder, you should set the enough permission to the IIS application pool identity.
You should use AD to assain enough permission to a spcial AD account.
Alternatively, using ActiveDirectory you could create a Domain User account, configure the application pool identity to use that domain user, and grant that user access to the network files.
More details, you could refer to below article:
http://www.iis.net/learn/manage/configuring-security/application-pool-identities

Cannot get Orchard CMS site to load on Network Solutions Windows Hosting

I get the following .NET error when trying to load my Orchard CMS website:
Access to the path '\\.........\www\App_Data\Dependencies\Lucene.dll' is denied.
Exception Details: System.UnauthorizedAccessException: Access to the path '\\WDP\DFS\30\7\4\5\3024678547\user\sites\5481517.site\www\App_Data\Dependencies\Lucene.dll' is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in File Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
How do I actually go about granting access rights? I've googled and found I should go into the server and right-click on the directory and edit the properties. BUT, I am in a shared hosting plan and don't think I can do that.
Am I pretty much at a dead end?
Things I've tried:
Setting file permissions through FTP, but I get a:
500 'SITE CHMOD 777...command not understood
I've downloaded and installed IIS Manager and successfully connected to my site, but still did not find any options to set permissions in there.
I've also called Network Solutions, but all I was told was to try to do the file permissions settings (as I mentioned above).
Thanks in advance.

What determines Authentication for a folder in IIS?

I have a folder under a web site that causes a request for authentication whenever I try and access it or any of its sub-folders. In IIS, 'Authentication' only has Anonymous enabled, and '.NET Authorization Rules' is set to 'Allow all Users'.
What could make IIS request authorization when I try and access this folder? Is there anything in the web app that could cause authorization to be requested?
This is IIS 8 under Windows 8. The application was developed under Windows 7 and transferred to Windows 8.
Anonymous Authentication uses an identity to access files on disk. You can check what identity by right-clicking Anonymous Authentication in IIS and selecting Edit... It is probably using IUSR (that is the default).
You have 3 options:
Give the IUSR account or the IIS_IUSRS group permission to access the folder
Set a different specific user that has access
Set Anonymous Authentication to use the application pool identity, then grant this (virtual) account permissions to access the folder

System.UnauthorizedAccessException while saving a file

I published my website on the IIS6.
When saving a file by File.WriteAllText("C:\" + txtSaveExport.Text + ".CSV", b.ToString());. Its gives an error as:
em.UnauthorizedAccessException: Access to the path 'C:\hj.CSV' is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.``
How can this be handled?
You need to give writing permissions to the Aspnet user in that folder.
See this:
http://devnet.logixml.com/rdPage.aspx?rdReport=Article&dnDocID=209
Best regards.
It's not a good idea to write to a variable directory under C: drive. I suggest you not to give permissions to write under C, rather, write to a directory under your web app's directory, which you can get by Server.MapPath("~"). Make sure you give write access to the application pool's user account to whatever folder under your app directory, and you'll be much safer.

Access to the path '0' is denied IIS 7

I have a web application developed in ASP.net 4.0 and hosted in IIS7(ProdServer).
In one of the pages I am creating a file and storing it in \someOtherServer\Storage\
folder.
when I log on to production server and hit run and \someOtherServer\Storage\
I am able to browse the folder.
When I run my ASP.net application I get the error
Access to the path '0' is denied.
Exception Details: System.UnauthorizedAccessException: Access to the path '0' is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
You will have to look at the identity of the apppool under which your ASP.net site is running and make sure that account has permissions to the resource on the other server.
To do this in IIS 7, do the following:
Open IIS manager and browse to the site where this is happening.
Right click on the site and select Manage Application -> Advanced settings.
The top most setting will show the name of the application pool you are running under. Most probably it is DefaultAppPool, but it could be something else too (preferably it should be something else).
Now cancel and click on the Application Pools node in IIS manager and right click on the application pool you saw above and select advanced settings.
Look at the Identity setting under process model - this might be ApplicationPoolIdentity. For you to access a resource on another machine you will have to run it either as NetworkService or as a domain account. I suggest you try the one and then the other. The domain account should be a service account which password does not expire (otherwise every time it expires you will have to retype it in here). Make sure that the domain account has access to the shared resource on the remote server.
Hope that helps someone.

Resources