Setting steps for setting up secure ASP.NET virtual hosts (reproduced)

xiaoxiao2021-03-06  40

As the order-based application-based application, the virtual hosts that provide .NET space also have more and more, but many virtual host providers are not very familiar with the permission assignment of the .NET environment, thus Leading the .NET procedure can't run well. Let's take a look at how to make a maximum authority that can have your own directory, but also allows users to operate access to other directories other than their directory. Rights Profile.

First of all, we must understand that a concept is that it can be made for the ASP.NET program, which is limited by the permissions used by the Network Server user (Win2003) or ASPNET user (Win2000). So, we only need to operate the NetWork Server user or the ASPNET user.

First, protect each hard drive cannot be accessed by the ASPNET.

We have a very simple program to check our permission settings. This applet is to list all the subdirectories in a directory, the source code is as follows:

String [] strings = Directory.getdirectories ("k: // winnt"); for (int i = 0; i

Before we do not make any settings, we can easily get normal results. Figure:

Obviously this is what we don't want to see. We only hope that the ASPNET operates on your own directory without interfereting any other directory. Below we will take the Win2003 system as an example, step by step, how to achieve this place.

First we find the K disk, and click on right-click> Sharing and Security and switch to the Security tab, click the advanced button below to enter the advanced security settings as shown:

Click Add button to find and select Network Service users:

Then click the OK button, and one window will be able to select the permissions you can have this user. Here, we will not reject except for "reading attributes", other all rejections (not "reading properties" refuse is very important, if they refuse, will cause the ASP.NET program All operations cannot be completed under the directory of rights (such as creating a directory in your own directory: no part of the path "x: /" is shown) as shown:

Click OK to complete the operation of this system, we run the above program to see if you can also remove the subdirectory list of other directories:

At this time, the system will prompt an error ... so that our system is guaranteed.

This way, the ASP.NET program can only operate its directory, and cannot involve other file directories.

转载请注明原文地址:https://www.9cbs.com/read-74159.html

New Post(0)