Find the answer to your Linux question:
Results 1 to 2 of 2
Well, I thought I knew permissions pretty well I want to keep permissions to a minimum on my system (as we all do). Here are some folders on my website: ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2003
    Posts
    57

    question on permissions


    Well, I thought I knew permissions pretty well

    I want to keep permissions to a minimum on my system (as we all do). Here are some folders on my website:

    dr-xrws--x 2 nobody cssteam 4096 May 29 16:52 archive
    dr-xrws--x 2 nobody cssteam 4096 Jun 22 10:11 common
    dr-xrws--x 3 nobody cssteam 4096 Jun 9 11:11 layers
    dr-xrws--x 2 nobody cssteam 4096 May 29 16:52 properties
    dr-xrws--x 2 nobody cssteam 4096 May 29 16:52 res
    dr-xrws--x 2 nobody cssteam 4096 May 29 16:52 rfm
    dr-xrws--x 2 nobody cssteam 4096 May 26 22:59 stretch
    dr-xrws--x 2 nobody cssteam 4096 May 26 23:39 tables

    PHP (apache) is running as user nobody. The group cssteam is the group that modifies my css files.
    I find that when I remove the "x" from the first column (user permissions), the css files in these folders are not available. How come? I mean, the folders are executable to everyone (x in the last column). Any ideas?

    thanks
    Sam Fullman

  2. #2
    Just Joined!
    Join Date
    Jul 2004
    Location
    Sarajevo
    Posts
    15
    this is only an example...

    I think that you should read the chmod manual (again maybe).

    dr-xrws--x 2 nobody cssteam 4096 May 29 16:52 archive

    d - stands for directory
    r - stands for read
    w - stands for wrtie
    x - stands for execute

    now do chmod a-rwx -R * (remove all premissions for everyone). do you know binary sistem (calculation). so take a paper place 1 where you want to enable the premission and 0 where you dont want.

    example:
    owner : r w x
    1 0 0
    in this case owner can only read and the number is 1
    other users: r w x
    1 0 1
    in this case other users can read and execute so the number is 5
    all users: r w x
    0 0 0
    so final it should be:
    chmod 150 -R *
    150 = 1 for reading owner ; 5 = 1+4 for read and execute

    so if r is 1 the result is 1
    if w is 1 the result is 2
    if x is 1 the result is 4
    if there is a 0 the result is 0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •