Jump to content

[SOLVED] CHMOD confusion


Full-Demon

Recommended Posts

Ey,

 

I use CHMOD because .htaccess doesn't work on my server. I want certain directories to be restricted. I want that only apache/php can read/write/execute. Nobody else, users should not be able to browse to/inside the directory.

 

What permissions should the directory have and what should the files/directories inside have?

 

Thanks in advance :)

 

FD

Link to comment
https://forums.phpfreaks.com/topic/65978-solved-chmod-confusion/
Share on other sites

1. Firstly find out the current permissions on your directory (as can be seen below).

2. Find out what "group" users are part of. It can be seen in the example below, that the owner is steviewdr, and the group is "users".

 

steviewdr@skynet:~$ ls -la | grep public_html

drwx-----x  21 steviewdr users    4096 2007-08-17 18:24 public_html

 

Therefore we want to allow the owner (rwx), and the world/www (x).

This is chmod 701.

 

steviewdr@skynet:~$ chmod 701 public_html/

 

So:

the user will be allowed to: read,write,execute

the word will be allowed to: execute into the folder.

 

The files inside public_html do not necessairly need to be chmod 701. It can if you like, by going: chmod -R 701 public_html.

 

-steve

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.