Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Small question about unix

Small question about unix
Thread Tools
Fresh-Faced Recruit
Join Date: Apr 2004
Status: Offline
Reply With Quote
Apr 6, 2004, 11:49 AM
 
ok i ma not stuiped but i just don't get this. chmod
you all know the chmod how to change perrmissions ok so i tryed that and it did'nt work for my macintosh hd.so i tryed it on all my other folders and it worked. so why can't i change my perrmissions which are set as i can only read. i but it on as a security but it's really annoying. so what would i do to change the perrmisions from raead only to read and write. i think it is chmod r=w macintosh hd but it fails what would i do on the terminal to change it??
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Apr 6, 2004, 01:46 PM
 
Originally posted by char the second:
ok i ma not stuiped but i just don't get this. chmod
you all know the chmod how to change perrmissions ok so i tryed that and it did'nt work for my macintosh hd.so i tryed it on all my other folders and it worked. so why can't i change my perrmissions which are set as i can only read. i but it on as a security but it's really annoying. so what would i do to change the perrmisions from raead only to read and write. i think it is chmod r=w macintosh hd but it fails what would i do on the terminal to change it??
All UNIX files have 3 sets of permissions. Permissions for the User (u), Permissions for the Group (g), and Permissions for Other (o). If you look at a file, you see this:

Code:
% touch foo % ls -l foo -rw-r--r-- 1 arkham admin 0 6 Apr 14:31 foo
The "arkham" is the user, the "admin" is the group.

If you break down the first field, you'll see three sets of permissions, plus a special flag.

Code:
- rw- r-- r-- ^ ^ ^ | | | | +--------------------------------+ | | +----------------------+ |other | +----------user permissions | |permissions +-------flag | group permissions
Within each permission there are 3 flags, r = Read, w = Write, and x = Execute.

So, if you look at a file, you can know its permissions. To change them, just use the following syntax for chmod:

Code:
chmod [who] [what change] [which file]
"who" is "u", "g", or "o"

"what change" is + or - to add or subtract, and "r", "w" or "x" (or a combination of those).

So, to add (+) group write and execute to a file:

Code:
chmod g+wx filename
To remove (-) the ability for group and others to read a file:

Code:
chmod go-r filename
As far as security, you have to own a file to change it. If you're not the owner, you can act as root using "sudo" before the chmod command.

Does that clear it up?
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Fresh-Faced Recruit
Join Date: Apr 2004
Status: Offline
Reply With Quote
Apr 6, 2004, 02:26 PM
 
ya thanks and i am the admin. thANKS
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:22 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2