XPost: comp.unix.internals, comp.unix.questions, comp.unix.shell   
   From: spamhater113+U050305054519@grymoire.com   
      
   "Eli Aran" writes:   
      
   > hi there   
   > i am learning unix on my own   
   > i need some elaboration on the concept   
   > of file and directory permissions.   
   > i dont understand the concept of "others" (the third option regarding   
   > permissions)   
      
      
   Each file has a user ID and group ID associated with it.   
   The system:   
    checks the user ID of the person, and the file.   
    If the number is the same, then permission is granted.   
      
   OTHERWISE   
    The list of groups of the user is obtained, and if one of them matches   
    the group of the file, permission is granted.   
      
   OTHERWISE   
    The "other" permission is used.   
      
      
   So if you have the following permissions (userID = 100, group ID == 200)   
    User Group Other   
    RWX --- R   
      
      
   User ID Group ID Permission   
   100 (doesn't matter) RWX   
   150 (200) None   
   151 151 R   
      
   Note that the "other" permission is used if UID != 100 AND GID != 200   
   If the GID matches, then "other" is never checked.   
      
      
      
   RWX in directories is a little different in what R, W and X means.   
      
      
   R = Read the contents of the directory   
   W = Create new files in the directory   
   X = use the directory in a path   
      
      
      
   So you can have a directory   
    /secret RWX--X--X   
   and a file   
    /secret/file RWXR-XR-X   
      
   "others" can use the file /secret/file, but thet cannot see any other   
   file in that directory. If /secret had RWXR-XR-X permissions, they can   
   see (read) the list of files in the directory.   
      
   If a directory has "write" permission, you can create new files and rename   
   files.   
   So if it was   
    /secret RWXRWXRWX   
    /secret/file RWXR-XR-X   
      
   you can rename /secret/file and replace it with your own.   
      
   So permission of directories are as important as permissions on files.   
      
   And it goes all the way up.   
      
   If the directory is in a directory with RWX permissions, you can rename the   
   directory.   
      
      
   --   
   Sending unsolicited commercial e-mail to this account incurs a fee of   
   $500 per message, and acknowledges the legality of this contract.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|