Administration
  Home arrow Administration arrow Page 5 - CHMOD: Tool for Open Source Administra...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
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? 
ADMINISTRATION

CHMOD: Tool for Open Source Administration
By: Drew Decker
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 29
    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:
      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

    The Web Buyer's Guide is your best source for white papers on a wide range of IT products and services. This Week's Featured White Papers: Protecting Web Applications from Attack and Misuse by Citrix Systems

    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.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Darwin Linux???
       · You mean "octal", i.e., base 8. Why spend so much wordage introducing IPs and octets...
       · should be darwin linux :D!
       · I have my way of explaining things. Is it because I'm 19 or it because I'm full of...
     

       

    ADMINISTRATION ARTICLES

    - 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
    - Advanced Concepts on Dealing with Files and ...
    - Dealing with Files and Filesystems
    - More Hacks for the User Environment in BSD
    - Personalizing the User Environment in BSD
    - Customizing the User Environment in BSD

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway