Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Permission Denied!!! Permissions Set??

Status
Not open for further replies.

jamesmcuk

IS-IT--Management
Aug 28, 2002
10
GB
Hi I have a simple Script that is sort of like a guest book. I have tried to run this script but end up getting permission denied all the time. I have told 2000 Server to give access for full control to both "Everyone" and the Anonomous internet user and have set write access in IIS. In fact every single write/modify/create permission is set to OK! I can now only think of two things. 1: my server hosts 3 sites using Host Headers - Will this cause a problem? 2: I know little to nothing about ASP or other settings in IIS so maybe there is a problem there?

Please help even if you have only a vague idea!

Thanks

James

Code is:

<%
MyFile = &quot;<Path to text file in same folder as this code>&quot;

'Ready Scripting.FileSystemObject
Set MyFileObj=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set MyOutStream=MyFileObj.OpenTextFile(MyFile, 8, TRUE)
New_line = Request.Form(&quot;new_line&quot;)
New_line = Server.HTMLEncode(New_line)
New_line = &quot;<I>Posted: &quot; & NOW & &quot;</I><BR>&quot; & New_line
MyOutStream.WriteLine(New_line)
MyOutStream.Close


Response.Redirect &quot;<any web page>&quot;
%>
 
Small Update

If I go to properties in IIS on the subfolder of the site that the asp is in and go to directory security and then change the User from IUSR<Compname> to my own domain user name and password the script will then work fine. As soon as I change it back though to the IUSR account and tick &quot;Allow IIS to control password&quot; the Permisscion Denied returns. Even though I have specified that this account has &quot;Full Control&quot; of the website root folder and the sub directory explicitly in explorer and have set the write check mark on the properties for both the root and the sub folder in IIS.
 
so its complaining about the IUSR_<servername> permissions for:
Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)


hth,
Foxbox
ttmug.gif
 
Thanks for your help. Unfortunatley I went through both exersises in the link and neither helped the problem. The error occurs on the line:

Set MyOutStream=MyFileObj.OpenTextFile(MyFile, 8, TRUE)


I think I have set that many permissions to full control now that I could remote control my server from anywhere!

Thanks again. Any more ideas?

 
In addition to the comment I made about the changing the user in IIS directory security I can now confirm that only Administrator level user names used there will allow the script to run. Any other user name results in either Permision Denied or the error &quot;You are not authorised to view this page&quot;.
 
Well Seems that if I give the IUSR account a password and then set that password in directory security removing the &quot;let ISS control the password&quot; then it works! Even when the account isn't admin. Is that correct? Should this be the case and will is cause me problems?
 
Ah Ha final update in case anyone else is stuggling with a similar problem. I found that the above code was trying to create a file in my WINNT\SYSTEM32 directory. So I specified a full file path and it sorted the problem and I now don't need to set a password for the IUSR account. Worringly though the IUSR account did manage to write to the system directory yet it has not permissions to do so. Just a password, if anyone has any ideas on that I would be interested.

Thanks

James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top