Miscellaneous
  Home arrow Miscellaneous arrow Page 2 - Rights Management in UNIX
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MISCELLANEOUS

Rights Management in UNIX
By: Gabor Bernat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2009-03-25

    Table of Contents:
  • Rights Management in UNIX
  • Groups and rights
  • Change the rights
  • Some extra rights

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Rights Management in UNIX - Groups and rights


    (Page 2 of 4 )

    The system splits users into four categories, from the point of view of identifying the rights:

    1) The user => symbolized in the chown command by a u letter.

    2) The group => g

    3) The others => o (users who are not in the users group or not the user)

    4) And finally, all => a (everybody)

    There are three types of rights:

    a) read => r 

    b) write => w

    c) execute => x

    These are the three tasks a user can do with a file or a directory. We can see this with the ls –l command typed into the terminal. This will list the rights for the current working directory files in the first columns of what appears when the command is used.

    For the first three user groups, there is an individual setting. These are written one after another. Where a right is in place, the corresponding letter is written. Otherwise, a minus is printed there.

    Let there be the right of rw---xrwx. We will split it into three categories, grouped by three letters. We will have the right of rw- for the user. This means he can write it and read it; however, he cannot execute it. The second group is “--x” and means that the people in the user's group can execute the file. The last three letters, rwx, are all turned on so everybody else can do what they want with the file.

    Summing up, rights management is like a code where every letter can be further expanded into the rwx trio. Of course, we can also work with binary numbers when we expand a letter. Let there be one if a right is active and zero otherwise. Now a letter (group) will form an octal number.

    Octal numbers are represented on three bits. 110 is equal to 1 * 2^2 + 1 * 2^1 + 0 * 2^0, which is also equal to 6. Now we can write all the rights with just three numbers, as long as we write the decimal pair of the octal number. Thus, 766 represents 111 110 110, which reserves for us and us alone the right of execution. The order is always user/group/others, or ugo. 

    More Miscellaneous Articles
    More By Gabor Bernat


     

    MISCELLANEOUS ARTICLES

    - Using PHP to Stream MP3 Files and Prevent Il...
    - 10 Must Have Firefox Improvements
    - All About OpenOffice 3.0
    - Shell Script Writing
    - Loops in the UNIX Shell
    - The Test in the UNIX Shell
    - Data Streams and the UNIX Shell
    - Control Mechanisms of the UNIX Shell
    - Variables Within the UNIX Shell
    - The Shell and UNIX
    - In Detail: UNIX File Systems
    - Rights Management in UNIX
    - UNIX File Systems
    - The Terminal in UNIX
    - Operating Systems and UNIX





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek