473,785 Members | 2,297 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

access denied in an asp.net 2.0 application when accessing a direc

on a different server.

I am currently getting an access denied when I attempt to do the following
in my asp.net page:

strFilePath = ConfigurationMa nager.AppSettin gs["imagesaved ir"];

strFileName = strImageName + ".*";

DirectoryInfo di = new DirectoryInfo(S erver.MapPath(s trFilePath));

FileInfo[] fls = di.GetFiles(str FileName);

This is the error:

Access to the path '\\192.168.2.26 \images\ProdSit e\CENET' is denied.

What permissions do I need to set for this to work. The ip address is on
another windows 2003 server.

Thanks

Eric

Mar 9 '06 #1
6 4546
I think you want to grant read permission and directory browsing on the
ntfs level (properties -> security) to the IUSR_<servernam e> account,
then grant the same thing on the iis level via IIS Manager. There's
two levels of security- IIS and NTFS.

Mar 9 '06 #2
Thanks for Michael's input,

Hi Eric,

As for such security issue, we should first confirm what's the ASP.NET
application's running security context, if you're not using impersonate, it
should be the ASP.NET worker process's process account(this setting should
differ from IIS5 to IIS6). For IIS, it is the Machine\ASPNET account ,
while IIS6 by default use Network Service as the application pool idenitity.

And as for the remote UNC share, there're two permission settings, the NTFS
and the file share permission settings. Therefore, I suggest you check both
of them on the remote server machine and grant the proper use the
sufficient permission.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




Mar 9 '06 #3
Hi Steven,

I am running IIS 6.0.

How would I find out what security context I am running under?

On the share, I set the NetworkService account from webserver read only
access and on the NTFS security, I gave NetworkService account from webserver
ready only access also.

Basically, I want the remote users to only read/browse the files but not
change the files.

Is this the correct approach?

Thanks

Eric
"Steven Cheng[MSFT]" wrote:
Thanks for Michael's input,

Hi Eric,

As for such security issue, we should first confirm what's the ASP.NET
application's running security context, if you're not using impersonate, it
should be the ASP.NET worker process's process account(this setting should
differ from IIS5 to IIS6). For IIS, it is the Machine\ASPNET account ,
while IIS6 by default use Network Service as the application pool idenitity.

And as for the remote UNC share, there're two permission settings, the NTFS
and the file share permission settings. Therefore, I suggest you check both
of them on the remote server machine and grant the proper use the
sufficient permission.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




Mar 9 '06 #4
Thanks for the response Eric,

I think it should be OK. Since you're using IIS6, if the ASP.NET
application virtual dir is configured to use the Default Application Pool
and your ASP.NET dosn't use impersonate, it should be the NT
AUTHORITY\NETWO RK SERVICE account. Anyway, you can use the below code to
printout the security identity of the current running thread:

Response.Write( "<br/>" +
System.Security .Principal.Wind owsIdentity.Get Current().Name) ;

BTW, as for the "Network Service" account you mentioned when configure the
UNC share's permission, are you sure you are refering to the ASP.NET
server's Network Service account( rather than the UNC share machine's
Network Service account)? Network Service just represent machine's account
so it differs from machine to machine.

In addition, you can turn on the File access Audit for that UNC folder on
that machine, this can help capture the Access failture log.

3How To Audit User Access of Files, Folders, and Printers in Windows XP
http://support.microsoft.com/kb/310399/en-us

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Mar 10 '06 #5
Thanks for the information.

Thanks

Eric

"Steven Cheng[MSFT]" wrote:
Thanks for the response Eric,

I think it should be OK. Since you're using IIS6, if the ASP.NET
application virtual dir is configured to use the Default Application Pool
and your ASP.NET dosn't use impersonate, it should be the NT
AUTHORITY\NETWO RK SERVICE account. Anyway, you can use the below code to
printout the security identity of the current running thread:

Response.Write( "<br/>" +
System.Security .Principal.Wind owsIdentity.Get Current().Name) ;

BTW, as for the "Network Service" account you mentioned when configure the
UNC share's permission, are you sure you are refering to the ASP.NET
server's Network Service account( rather than the UNC share machine's
Network Service account)? Network Service just represent machine's account
so it differs from machine to machine.

In addition, you can turn on the File access Audit for that UNC folder on
that machine, this can help capture the Access failture log.

3How To Audit User Access of Files, Folders, and Printers in Windows XP
http://support.microsoft.com/kb/310399/en-us

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Mar 10 '06 #6
Thanks for the quick response.

Glad that they're of assistance. Please feel free to let me know if you
need any further help.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Mar 10 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2037
by: Ed | last post by:
I have searched the archives and found several entries that address the problem I'm having, however, the solutions fall short of explaining exactly what to do Like many others, when I attempt to access an Excel file via an ASP.NET page, I get an access is denied error on the line "dim XSL as new Excel.application" some solutions tell me to change my authentication in web.config file - I don't know what to chang some solutions tell me to...
0
796
by: David | last post by:
Hi I wrote an windows application accessing web services method. Everything works perfectly. My system crashed, I install the VS.NET 2003 Pro. Suddenly i realized that i required to used some of the ETP in VS.NET 2003 EA. Therefore, i uninstall VS.NET 2003 Pro and install VS.NET 2003 EA. Finally, i setup my windows application and my web services method. I run the application an had an error message when the application accessing the web...
4
3918
by: Fabian von Romberg | last post by:
Hi, I have installed Sql Reporting Services on 2 machines, one is WIN 2000 PRO and the other one is WIN 2000 ADV. SERVER. When I try to access a report using the webbrowser, I get the following error, this happens only if try access the report on the SERVER, it I try on my local machine, it works just fine. Any help will be much appreciated. Thanks in advance, Fabian von Romberg
3
2549
by: buran | last post by:
Dear ASP.NET Programmers, I am trying to save a new created Word document, but getting the following the error. I granted the necessary rights to the ASPNET user, but I'm still getting this error. Thanks in advance, Buran Dim objWordApp As New Microsoft.Office.Interop.Word.Application()
0
2643
by: George | last post by:
Hello, I'm running an ASPX application "WebApplication1" which consumes a web service (service1.asmx) hosted on a machine with IP (128.1.7.x) . The web service is located in the intranet. The web methods can be invoked successfully if "WebApplication1" is located in machines with the same subnet (128.1.7.x). However, it fails if "WebApplication1" is hosted on
12
5102
by: Chad Crowder | last post by:
Hi all, I hope someone can give me a hand, because I'm out of ideas. I keep getting this message: Access to the path "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\projects_cig\e4e3b3da\3c20ac69" is denied. The error goes on to say that the ASP.NET is not authorized...
3
4006
by: Mark | last post by:
I'd like to avoid displaying the nasty built-in ASP.NET error for a 401.2, access denied. We're using windows authentication. The error message that is displayed by default is printed below. I'd love for it to redirect to the 401-2_access_denied.htm file I've created in the root of my web site. The text below is from my web.config file. <customErrors defaultRedirect="error.htm" mode="On"> <error statusCode="401.2"...
3
567
by: Olivogt | last post by:
Hello, I was just puting an application on the web server but it did not work as usual... - I do develop on my notebook and move released applications to the Web server - both have Sql Server 2000 - In this particular application I have a form login based on Username/Password from a database table - the start page of the application has a datagrid, both pages are accessing ONE database but an other table - It seems that the username and...
2
12876
by: =?Utf-8?B?RWRkaWU=?= | last post by:
Here is my scenario for a problem I can't solve. I am hosting a 3.5 WCF service in IIS on Windows Server 2003. The service works fine with the WCF test client in Visual Studio 2008 and from an ASP.Net client hosted on my development machine in VS2008. As soon as I deploy the ASP.net client to the "Same" IIS server, I get Access Denied messages. My goal is to use AD security groups so the authenticated user on the ASP.net page should be...
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.