Most of the virtual hosts are now disabled: FileSystemObject, because this component provides powerful file system access capabilities for ASP, read, write, copy, delete, rename, etc. Operation (of course, this means to do it under Windows NT / 2000 using the default setting). But after prohibiting this component, the consequences caused by all ASPs that use this component will not be able to run, and cannot meet the needs of customers.
How to allow both FileSystemObject components, do not affect the security of the server (ie: Different virtual host users can not use the component to read and write the files)? Here is a method that I have obtained in the experiment, which is described below with Windows 2000 Server as an example.
Open the resource manager on the server, right-click the drive letter of each hard disk partition or volume, select "Properties" in the pop-up menu, select the Security tab, you can see which accounts can be accessed to access this partition Volumes and access rights. After the default installation, "Everyone" has full control. Add "Administrators", "Backup Operators", "Power Users", "Users", etc., and give "full control" or corresponding permissions, pay attention, do not give "Guests" group, "IUSR_ machine name" these accounts any permissions. Then, "Everyone" group is then deleted from the list, so that only authorized groups and users can access this hard disk partition, and when the ASP is executed, it is access to the hard disk as "IUSR_ machine name", this is not given here User account permissions, ASP can also read and write files on the hard disk.
The following is to set a separate user account to each virtual host user, and then assign each account to a directory that allows its fully controlled.
As shown in the figure below, open "Computer Management" → "Local User and Group" → "User", click the right mouse button in the right column, select "New User" in the pop-up menu:
In the "New User" dialog box in the pop-up, "User Name", "Full Name", "Description", "Password", "Confirm Password" are entered according to actual needs, and the "user must change the password next time" The right pair is removed, and "the user cannot change the password" and "password never expire". This example is a built-in account "IUSR_VHOST1" that creates an anonymous access Internet information service to the user of the first virtual host, ie: all clients use
Http: //xxx.xxx.xxxx/ When accessing this virtual host, it is accessed in this identity. Enter the completion of the "creation". You can create multiple users according to actual needs, and after the creation is complete, "Close":
Now the newly established user has already appeared in the account list, double-click the account in the list to further set up: "IUSR_VHOST1" (ie, the new account, the new account ", is affiliated to the" tab : Just created account defaults belonging to the "User" group, select the group, click "Delete": The present is as shown in the following figure, then "Add": Find in the "Select Group" dialog box "GUESTS", click "Add", this group will appear in the following text box, then click "OK": The appearance is the content shown below, click "OK" to close this dialog box: Open Internet Information Service ", start setting the virtual host, in this case, to explain the" first virtual host "setting as an example, right click on the host name, select" Properties "in the pop-up menu: Pop up a" first virtual Host Properties dialog, from the dialog box, you can see the "F: / Vhost1" folder: Temporary "First Virtual Host Properties" dialog, switch to " Resource Manager, find "f: / vhost1" folder, right click, select "Properties" → "Security" tab, at this time, you can see the default security settings of the folder is "Everyone" full control (depending on " The content displayed in different situations is not exactly the same), first "allowing the ability to allow the inheritance of the inheritance from the parent to the object to the object" to remove: At this time, the "security" warning as shown below is populated. Click "Delete": All groups and users in the Security tab will be empty (if not clear, use "Delete" to empty it), then click the "Add" button. Add "administrator" as shown in the figure, add the new account "IUSR_VHOST1" created in the previous, will give full control permissions, but also add other groups or users according to actual needs, but must not put "guests" group , "IUSR_ machine name" these anonymous access to the account added! Switch to the previously opened "First Virtual Host Properties" dialog, open "Directory Security" tab, "Edit" on the anonymous access and verification control: The "Verification Method" other box (below the figure below) Show), click "Edit": "Anonymous User Account", the default is "IUSR_ Machine Name", click "Browse": Find the new account "IUSR_VHOST1" created in the "Select User" dialog box, double click At this time, the anonymous username is changed. When entering the previous creation in the password box, the password set for the account: OK, then the password: OK, complete it, click OK to close these dialogs. After this setting, the "first virtual host" user uses the ASP's FileSystemObject component to access its own directory: F: / vhost1, when trying to access other content, there will be, such as "no permissions", "The hard disk is not ready", "500 server internal error" and other errors prompts. Another: If the user needs to read the partition capacity of the hard disk and the serial number of the hard disk, the setting will not be read. If you want to read these and the entire partition related content, right click on the partition (volume) of the hard disk, select "Properties" → "Security", add this user's account to the list, and give at least "read "Permissions.