Find the answer to your Linux question:
Results 1 to 4 of 4
Hi all, every linux user is aware of the SGID and StickyBit concept............now my question s this.....suppose user " roo t" creates a directory " /mnt/test " , it will ...
  1. #1
    Just Joined!
    Join Date
    Oct 2004
    Posts
    17

    SGID and Sticky Bit

    Hi all,

    every linux user is aware of the SGID and StickyBit concept............now my question s this.....suppose user "root" creates a directory "/mnt/test" , it will be created default with group "root"..........so i change the group ownership now to my group "emp" in which i have 2 users "x" and "y".............

    when i change the wonership i see that the permissions set for "test" directory does not contain Write Permission for Groups but Read and Execute are there.........so i change the rights by issuing "chmod 0775 test".............so now i have got RWX for Groups...........

    now comes the part..........i set SGID for this directory.........i have to set by issuing,
    "chmod 4775 test" which implies that i have to set the permissions for the file too and if it is set already, i should remember those permissions.........so now how can i remember the permissions for all the files!!.......

    My Commands which describes the above sequences..
    ===============================================
    #mkdir /mnt/test
    #chgrp emp test
    #chmod 0775 test
    #chmod 4775 test


    IS THERE ANY METHOD WHICH ALLOWS ME TO SET 'SGID' OR 'STICKYBIT' DIRECTLY TO A FILE??

    thanks in advance...

    with regards,
    C.C.Chakkaradeep

  2. #2
    Linux Newbie
    Join Date
    Apr 2005
    Location
    Charlottesville, VA
    Posts
    175
    There is indeed such a method. It's called 'chmod':
    Code:
    chmod +s /mnt/test
    should do it.
    ---sxeraverx---
    Linux without a C Compiler is like eating Spaghetti with your mouth sewn shut. It just doesn't make sense.

  3. #3
    Linux Engineer
    Join Date
    Apr 2005
    Location
    Buenos Aires, Argentina
    Posts
    908
    You'd do the same but with +t for the sticky bit.
    serzsite.com.ar
    "All the drugs in this world won\'t save you from yourself"

  4. #4
    Just Joined!
    Join Date
    Oct 2004
    Posts
    17
    Hi all,

    thanks a lot people...i did forgot abt the "chmod" option...



    with regards,
    C.C.Chakkaradeep

Posting Permissions

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