Administration
  Home arrow Administration arrow Page 5 - CHMOD: Tool for Open Source Administration
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
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? 
Google.com  
ADMINISTRATION

CHMOD: Tool for Open Source Administration
By: Drew Decker
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 31
    2005-12-05


    Table of Contents:
  • CHMOD: Tool for Open Source Administration
  • chmod Reasoning
  • Switches
  • Modes
  • Mentally Converting from “read/write/execute” to 777

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    CHMOD: Tool for Open Source Administration - Mentally Converting from “read/write/execute” to 777
    ( Page 5 of 5 )

    Now we go through the process of converting the -r, -w, -e modes, to the numerical (faster) way of implementing a chmod command. Remember how I said that the first three bits in binary (read 4, 2, 1) are what are used for read, write, and execute? That’s what we use. Look at Figure 2 to see this in a graphical implementation.


    Figure 2

    But that’s just one number. Yes, that one number is the first number, which is used for the owner. We still have two other permissions to set: one for group and one for world. You do the same for group and world as we did for owner: convert the textual (read, write, execute) permissions to the octet (777) permissions.

    As we do this over the process, we come up with a situation. We need to set the following permissions for a file called test.txt: owner = read, write, execute; group = read, execute; world = read. This is our practical example. The permissions would be: 754. To get this follow Figure 3 as a guide.


    Figure 3

    So by way of the guide, you just add up the numbers that are “on” and leave out or put a zero (0) in place of an “off” number. You get your number and you go to the next object. When you are finished you come out with three (3) numbers; this is the chmod mode you are going to use. Remember that your mode is just permissions, so if you want to set certain permissions, your mode will change.

    Using the Octet version of chmod in UNIX/Linux

    Now that we know how to convert from mode permissions using -r, -w, -e to 777 (note: it's not always 777, it could be 755 -- it’s dependent on your permissions), we can now use this methodology in a UNIX/Linux environment. Say that we want to do a basic chmod, giving the owner read and write access, group write access, and the rest of the world read access to a file called text.txt. The following would be the correct way to do it:

    Bash

    • chmod -v 624 test.txt

    That’s it! Take if from here, explore more ways of using the command line syntax. Don’t just look at it from the chmod perspective, look up other commands and compare them. Most of all, have fun and learn something new! Hope you enjoyed the article and that it helped you.



     
     
    >>> More Administration Articles          >>> More By Drew Decker
     

       

    ADMINISTRATION ARTICLES

    - Network Booting via PXE: the Basics
    - Scalix: Linux Administrator`s Guide
    - Network Administration with FreeBSD 7
    - Components of an Information Architecture
    - The Anatomy of an Information Architecture
    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization





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