views:

88

answers:

1

Hi friends,

just messed the websites at host by changing permission settings :( none of sites are working now!!! it gives

Forbidden

You don't have permission to access / on this server.

error! how can i fix it?! should i make files' permissions as 644?

thanks!!!

+2  A: 

I think that 755 should do.

Basically, you shouldn't grant write permissions for any file/directory to anybody but yourself (the owner), except for dirs/files which are explicitly required by a particular website/framework to be writable. A common example would be a directory for uploading avatars by users of a forum application.

What matters is that you most probably need the 5 for others (hence, you might try 705 and it still could work) to grant execute access for foreign users. While it might not make sense to set +x for all your website's files, the directories use the execute right to check whether the user is allowed to enter that directory. If you set the rights of everything (including directories) to 644/744, nobody except the owner will be able to browse the directory structure of particular folders. As the http daemon hardly ever is run as the directory owner's process, it might be the reason why your website stopped working.

Neo
thanks for reply so much!! is 755 safe enough for any files at host? I stupidly have changed all files' permissions including system, cgi-bin, etc... :( is there any particular file needs particular permission setting?
artmania
i just made all files as 744, and still not working, still Forbidden error! :(
artmania
just set 705 and working fine!! I appreciate so much !!! do you think is 705 safe for any files/folder?
artmania
`chmod -R 744 /` ? I'd agree it was "stupidly" done ;) What I would recommend is setting 755 for `/usr/bin` and `/usr/local/bin`. After this (assuming you set 744 for everything) enter your website directory (the root directory of all websites) and set 755 for subdirectories only - `find . -type d -exec chmod 755 {} \;`
Neo

related questions