" chmod command problem? "
Results 1 to 9 of 9

Thread: " chmod command problem? "

  1. #1
    Member
    Join Date
    Nov 2001
    Posts
    31

    " chmod command problem? "

    in the unix command chmod 2770 /home/samba what does 2 stands for ?
    any help is highly welcomed
    hackmania
    vpandiya

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Posts
    712
    Is this the "ask all your general UN*X questions" forum or something? Perhaps you need to visit comp.os.unix.* or something...


    I suggest "man chmod" or "info chmod" on your UN*X box.
    \"Windows has detected that a gnat has farted in the general vicinity. You must reboot for changes to take affect. Reboot now?\"

  3. #3
    Member
    Join Date
    Nov 2001
    Posts
    31
    well my freind...
    i'm recently working and learning this wonderful OS base on UNIX ,,,so it is but obvious
    that my problems will be related to it,,,,, as i 'm a a newbie so i have chosen correct sectionas
    i far as i suppose,,,,
    well,, if u think as senior memberthati made a mistake then i 'm sorry,,,
    man chmod and info's help is very terse and unclear,, so i will be greatefu lto u friends if u can answer my question?

    thanks to all reading this post
    vpandiya

  4. #4
    AO Curmudgeon rcgreen's Avatar
    Join Date
    Nov 2001
    Posts
    2,716
    According to the man page, "the first digit selects the set user id"

    If a program belongs to a certain user, or to ROOT, it cannot be
    executed by non-priveliged users. If the program must perform
    important priveliged tasks in the system, and yet you want
    ordinary users to be able to execute it, you have a dilemma.

    The set user id (suid) bit can be set for a file so that a user
    can execute the priveliged program without giving the
    user any extra priveliges.
    I came in to the world with nothing. I still have most of it.

  5. #5
    Senior Member
    Join Date
    Mar 2002
    Posts
    425
    Ah, rcgreen, you are correct about the sticky bit in regards to suid programs, but hackmania specifically asked about 2770. As far as I know that is the set group bit, and only applies to directories. If you chmod a directory with the permissions 2770, then every file created in that directory will automatically have the group set to the group that owns the directory instead of the user's group, which is what it would normally be set to.

  6. #6
    Senior Member
    Join Date
    Nov 2001
    Posts
    120
    i think its in octal format.try a search on google.

  7. #7

  8. #8
    Senior Member roswell1329's Avatar
    Join Date
    Jan 2002
    Posts
    670
    Ah, rcgreen, you are correct about the sticky bit in regards to suid programs, but hackmania specifically asked about 2770. As far as I know that is the set group bit, and only applies to directories. If you chmod a directory with the permissions 2770, then every file created in that directory will automatically have the group set to the group that owns the directory instead of the user's group, which is what it would normally be set to.
    str34m3r -- You're absolutly correct about the meaning of the 2 in that chmod value, but be careful what you call it. Any chmod octal value of 2000 is the set group id bit, and any chmod octal value of 4000 is the set user id bit. Both the set group id and set user id are represented by an s in the permissions report (ie: _r_s__x__x is the permission setting for /usr/bin/passwd.). The sticky bit is something else. Actually, the sticky bit isn't used much anymore, but it's represented by a t in the execute field for the world, (ie: drwxr_xr_t). Here's how O'Reilly defines it:

    Unix directory access permissions say that if a user has write permission on a directory, she can rename or remove files there–even files that don't belong to her. Many newer versions of Unix have a way to stop that. The owner of a directory can set its sticky bit. The only people who can rename or remove any file in that directory are the file's owner, the directory's owner, and the superuser.
    You can set the sticky bit with the 1000 octal value. For example, the command chmod 1777 would give you (drwxrwxrwt).
    /* You are not expected to understand this. */

  9. #9
    Senior Member
    Join Date
    Mar 2002
    Posts
    425
    My apologies for using the incorrect term. I hope I didn't confuse you hackmania.

Posting Permissions

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

 Security News

     Patches

       Security Trends

         How-To

           Buying Guides