简体   繁体   中英

ASP.NET IIS 7.5 can't write to shared folder

I have a simple app that does some file shuffling to/from some FTP sites and network shared folders. My web.config is as such:

   <system.web>
    <compilation debug="true" targetFramework="4.0" />
    <authentication mode="Windows" />
    <customErrors mode="Off" />
  </system.web>
  <system.webServer>
    <security>
      <authorization>
        <add accessType="Deny" users="?" />
      </authorization>
    </security>
  </system.webServer>

The windows auth appears to be working correctly as my page displays my domain\\account name when I visit. However regardless of the fact that I've added the "Everyone" group to the destination folder with full access rights I'm still getting this error:

System.UnauthorizedAccessException : Access to the path is denied

My site is running on IIS 7.5 with it's own application pool. When I run the pool under ApplicationPoolIdentity the windows auth doesn't work, it endlessly prompts me for my password even though it has my domain\\account correct.If I switch the Identity to NetworkService the windows auth works seamlessly but I still can't write to my network folder due to an access to the path is denied error.

I've read all sorts of things here and elsewhere and I've not found a single solution that has worked. I'm aware of my own limitations when it comes to ASP.NET and IIS security so I fully expect I'm making some mistake but have no on site peers with those skills to consult with.

Any advice on where to get started on understanding the security model as it pertains to getting a web site on one machine capable of writing to a shared network folder on another would be very much appreciated.

Try setting the application pool identity to a custom account using your domain\\username and password. I need to do this on a couple of my sites where my application accesses folders on a network share.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM