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?