SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: chmod 777

  1. #1
    SitePoint Member
    Join Date
    Apr 2001
    Location
    Arizona
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello, I have seen this being used on this forum, could someone tell me what this is and how it is used. I understand that it used to change permission of a file, but what does 777 have to do with it? Thanks...

    Viper420

  2. #2
    SitePoint Addict SLeon's Avatar
    Join Date
    Sep 2000
    Location
    Northern California
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All the numbers (777, 755, 666, etc.) are basically shorthand for a certain combination of permissions (read/write/execute) granted to groups of users. For example...some users can only read, some can do all, and so on..."777" is just a particular combination. (I don't remember which combination at the moment.)
    InformationSavant - developing intelligent web business
    StrangePegs.com - collectible cards, games, toys, comics

  3. #3
    SitePoint Addict
    Join Date
    Feb 2001
    Location
    Shanghai, China
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    400 - owner has read permission
    200 - owner has write permission
    100 - owner has execute permission
    040 - group has read permission
    020 - group has write permission
    010 - group has execute permission
    004 - world has read permission
    002 - world has write permission
    001 - world has execute permission

    The lowest possible mode value is 000 - which means no one can read, write, or execute the file. The highest possible value is 777 - which means everyone can read, write and execute the file.

    "chmod 777 notes"
    The owner can read, write and execute notes. The files specified group and all other users may only read the file.

  4. #4
    SitePoint Member
    Join Date
    Apr 2001
    Location
    Arizona
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks smorb. I have a php book, but it does not give a list like the one you gave. Thanks again.

    Viper420

  5. #5
    SitePoint Addict
    Join Date
    Jul 2000
    Location
    North Central AR
    Posts
    231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Viper,

    Remember though to be carefull, you keep any or all of your files at 777, everyone can read and more importatly write to those files. Somewhat of a security risk. Just something to remember...

    ronnie
    The largest selection of PLR Articles on the Planet!
    Many Private Label Rights Products.

  6. #6
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    smorb as ronnie pointed out 777 means anyone can read, write and execute the file!

    I like to look at chmod permission numbers like this:

    Each numeral in the chmod command represents (in orders):
    Owner | Group | Others

    Now each numeral is the sum of a combination of the following:
    Read = 4
    Write = 2
    Execute = 1

    So if we want to give the owner read, write and execute permission we set the first numeral to 7 (4+2+1). If we want to give the group read,write permission we set the second numeral to 6 (4+2) and if we want to give others read, execute permission only we set the third numeral to 5 (4+1). You might see that the numbering system used is octal (or not - that may just confuse )

    So in the above example chmod 765 notes means that the permissions for file notes are:
    Owner - read, write, execute
    Group - read,write
    Others - read, execute
    Last edited by freakysid; Apr 30, 2001 at 19:44.

  7. #7
    SitePoint Member
    Join Date
    Apr 2001
    Location
    Arizona
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks freakysid, that cleared up everything...Viper420

  8. #8
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Basically you just add up smorb's values.

    Of course, freakysid has already explained it, but it just hit me that this is a handy way of working it out!

    400 - owner has read permission
    + 200 - owner has write permission
    + 040 - group has read permission
    = 640


    of course you never add any more than once.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff


Bookmarks

Posting Permissions

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