How do I chmod directories to 777?

Aziz

Verified User
Joined
Oct 4, 2004
Messages
125
I am trying to create the sub domains via the API, the problem is that I am not able to write into that directory (files) because its not chmoded to 777. How can I chmod the files when creating the sub domains via the api?

and is it normal that I can not write into dirrecotriies unless they are chmoded to 777?

thanks alot,
aziz
 
Well I do not know how to make DA default to giving perms of 777 to new directories when they are created however. I will say that I am glad that it is not the default.

How are you trying to upload files to the server that you need 777 perms? If you log in as the user of the domain via ftp you should have no problems uploading files.

You only need a directory world writable if you want anyone and their dog to be able to upload, delete or otherwise change the files in the directories. So, yes it is normal that you need 777 perms if you want anyone to be able to write to a directory. However it is not really all that normal to do so, especially by default.
 
DamnSkippy said:
Well I do not know how to make DA default to giving perms of 777 to new directories when they are created however. I will say that I am glad that it is not the default.

How are you trying to upload files to the server that you need 777 perms? If you log in as the user of the domain via ftp you should have no problems uploading files.

You only need a directory world writable if you want anyone and their dog to be able to upload, delete or otherwise change the files in the directories. So, yes it is normal that you need 777 perms if you want anyone to be able to write to a directory. However it is not really all that normal to do so, especially by default.

I have a client in which he needs an upload folder (of which users can upload to that directory)..

now when I used php move_upload, the directory must be chmod to 777 or it wont allow me..

Is there any danger of hacking, even if I place an index.htm (chmod 444) in that direcotry?)..

I apprecaite your response,

Thanks,
Aziz
 
The index.html file will only keep the directory from being listed. If a hacker knew the filename and was somehow able to get malicious code in the file in a way that it could be executed from the web, then there is a problem.
It would be better that if you MUST have it 777 you place it in a non web accessible location and access it entirely through your script, putting all necassary safegaurds in there.

Have you tried using php's posix module to change to the necassary privileges to read/write from directories without them having to be chmod'd 777?
 
jmstacey said:
The index.html file will only keep the directory from being listed. If a hacker knew the filename and was somehow able to get malicious code in the file in a way that it could be executed from the web, then there is a problem.
It would be better that if you MUST have it 777 you place it in a non web accessible location and access it entirely through your script, putting all necassary safegaurds in there.

Have you tried using php's posix module to change to the necassary privileges to read/write from directories without them having to be chmod'd 777?

I have looked it more:
http://docs.php.net/en/ref.posix.html

but do not see how to make it work for my cause..

can you please explain it..

thanks,
aziz
 
Back
Top