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
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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.