Find the answer to your Linux question:
Results 1 to 8 of 8
I came across this command on the red hat site Code: chmod 2775 /usr/share/emacs/site-lisp the link is here 32.5.1.*Group Directories I find it confusing , how come there are 4 ...
  1. #1
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493

    chmod 2755 work/

    I came across this command on the red hat site
    Code:
    chmod 2775 /usr/share/emacs/site-lisp
    the link is here 32.5.1.*Group Directories
    I find it confusing , how come there are 4 number specifying the permission and also doing as instructed the permission of the directory has a 's' in the groups place . What does this mean???
    Only if I could understand the man pages
    Registered Linux user #492640
    OS: RHEL4,5 ,RH 9,Ubuntu

  2. #2
    Just Joined! RFahy's Avatar
    Join Date
    Jun 2009
    Posts
    11
    The "s" would stand for "sticky" I believe. For directories where anybody can add files, yet nobody can delete them.

    Edit: my mistake, above. You have set the Set Group bit.
    From what I know, that means that the file/folder will borrow the owner user's group ID.
    Same for Set User bit which borrows owner user's user ID.
    Here's the manpage, please do correct me if I said anything wrong.

    man chmod:
    Code:
          A numeric mode is from one to four octal digits (0-7), derived by adding
           up  the  bits with values 4, 2, and 1.  Omitted digits are assumed to be
           leading zeros.  The first digit selects the set  user  ID  (4)  and  set
           group ID (2) and restricted deletion or sticky (1) attributes.

  3. #3
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493
    there are supposed to be only three digits for assigning permission If I m not wrong . So wat is that extra '2' doing there?
    Only if I could understand the man pages
    Registered Linux user #492640
    OS: RHEL4,5 ,RH 9,Ubuntu

  4. #4
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    665
    as previously stated, the 2 adds the group's sticky bit. any file created in that directory after that bit is set will automaticaly inherit the group owner.

    most commands in linux have several syntaxes to be able to do different things. by putting 4 numbers instead of 3, you modify the sticky bit settings.
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  5. #5
    Just Joined! RFahy's Avatar
    Join Date
    Jun 2009
    Posts
    11
    Quote Originally Posted by vickey_20 View Post
    there are supposed to be only three digits for assigning permission If I m not wrong . So wat is that extra '2' doing there?
    Actually there are supposed to be 4 digits. But since few really need to mess with the SGUID, SUID and Sticky bits, only the basic 3 are used for permissions. The missing digits are considered zero.

    So if I were to use
    Code:
    chmod 7 file.txt
    , it would be the same as using
    Code:
    chmod 0007 file.txt

  6. #6
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493
    Quote Originally Posted by RFahy View Post
    Code:
    chmod 7 file.txt
    , it would be the same as using
    Code:
    chmod 0007 file.txt
    shouldn't be it this way
    Code:
    permission for new file 
    0700 file.txt
    Only if I could understand the man pages
    Registered Linux user #492640
    OS: RHEL4,5 ,RH 9,Ubuntu

  7. #7
    Just Joined! RFahy's Avatar
    Join Date
    Jun 2009
    Posts
    11
    You're invited to try it out and see for yourself.
    Code:
    chmod 7 file.txt
    ls -l file.txt

  8. #8
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493
    ya you are right !!
    Only if I could understand the man pages
    Registered Linux user #492640
    OS: RHEL4,5 ,RH 9,Ubuntu

Posting Permissions

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