Results 1 to 5 of 5

Thread: Chmod..

  1. #1
    Join Date
    Jun 2008
    Location
    Dublin, Ireland
    Posts
    298

    Default Chmod..

    I got tired of getting permissions errors on Apache/Zend/PHP so I did:

    Code:
    chmod -R 777 my_website_root
    I know.. a bit silly... Now Apache will serve up practically everything, even breakfast

    How do I go back, 777 is the only modifier I know..

    /jlar

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Chmod..

    And it's a mode that should very seldom be used. Much more useful to learn these two commonly used modes: 644 and 755.

    All numbers to you? Try these equivalent descriptors u=rw,g=r,o=r and u=rwx,g=rx,o=rx.

    Still just a bunch of letters to you? Then try this tutorial: File system permissions - Wikipedia, the free encyclopedia

    Oh and how to get back your original modes. Well if you didn't have a backup, then you have to guess what the original modes were. Something to think about next time you are tempted to do a chmod -R.

  3. #3
    Join Date
    Jan 2008
    Location
    N40 44.977 W073 59.356
    Posts
    1,170

    Default [MOVED]Re: Chmod..

    eeijlar wrote:

    >
    > I got tired of getting permissions errors on Apache/Zend/PHP so I did:
    >
    >
    > Code:
    > --------------------
    > chmod -R 777 my_website_root
    > --------------------
    >
    >
    > I know.. a bit silly... Now Apache will serve up practically
    > everything, even breakfast
    >
    > How do I go back, 777 is the only modifier I know..
    >
    > /jlar
    >
    >

    Thread moved from General to Applications forum
    (opensuse.org.help.applications)

  4. #4
    Join Date
    Jun 2008
    Location
    United States
    Posts
    423

    Default Re: [MOVED]Re: Chmod..

    For the number side of Chmod, it's based on there numbers...
    • 4 = Read
    • 2 = Write
    • 1 = Execute

    If you notice, you can't add any of these numbers up to equal another set. IE: If I want to add the permissions to execute and write for root, I would add 1 + 2 = 3, so I would issue the command: chmod 300 file.txt. You can also use the alphabetical method for permissions: you can add just one permission at a time, rather than editing the entire set as in the case of the number method. For this, you need to declare which type of user will gain or lose a specified permission. In short, you have to the issue a command like the following:
    Code:
    chmod u+w file.txt
    The above command will allow the group: User to write this file. The different groups include...
    • u = User
    • g = Group
    • o = Others
    • a = All User

    Then you can also change the plus sign (+) to a minus sign (-) to remove a permission. The following...
    Code:
    chmod u-w file.txt
    That would remove "User" permission to write the file.

    In your case, I would go with the numbers method, so you can edit all the permissions all at once rather than changing them one-by-one.

    Hope that helps.

    Folding@Home
    Help save lives with Folding@Home

  5. #5
    Join Date
    Jun 2008
    Location
    Dublin, Ireland
    Posts
    298

    Default Re: Chmod..

    Thanks everyone...

Posting Permissions

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