FILES: ------ Permissions Read - Ability to open and view the contents of the file Write - Ability to change and/or delete the file eXecute - You can "run" the file Refer to these permissions using the letters "r", "w" and "x". This is called a permission triple. These permissions can be applied to three different access "levels". User ( Owner ) - Person that owns file Group - Group that owns the file Other - Neither the owner, nor the group UUUGGGOOO -rwxrwxrwx - "Full perms" -r-xr-xr-x - "Full read-only perms, with full execute perms" Users: bob, alice, jack, nancy, joe Groups: mgmt - bob, alice marketing - jack, bob devel - nancy, joe staff - bob, alice, jack, nancy, joe -rw-r--r-- Announcement - owner: bob, group: marketing - Who can edit this file? Bob - Who can read the file? everyone - Who can execute this file? nobody! -rw-rw---- index.html - owner: nancy, group: devel - Who can read this file? nancy and joe! - Who can edit this file? nancy and joe! - Who can execute? Nobody! - Who can delete this file? nancy and joe! -rwxr-xr-x page - owner: joe, group: mgmt - Who can read this file? everybody! - Who can edit this file? joe! - Who can execute this file? everybody! Common permission triples: rwx rw- r-x r-- --- -w- -- "exists", but not useful -wx -- ditto --x -- ditto DIRECTORIES: ------------ Permissions: Read: Ability to list the contents of the directory Write: Ability to create/delete/modify files in the directory eXecute: Ability to "cd" into the directory ( make it CWD ) Common permission triples: rwx r-x --- r-- Not common - it can be used, but only allows viewing of entries in directory - also, causes problems with some software.. --x Doesn't even make sense rw- Ditto -w- Ditto -wx Ditto Changing file permissions 1) Changing owners: "chown" command # chown student /tmp/test 2) Changing group ownership: "chgrp" command # chgrp students /tmp/test 3) Changing permission triples: "chmod" command Two ways of executing chmod: 1) Uses octal numbers to specify specific triples # chmod 755 /tmp/test rwx Chart of octals: Should memorize --------------------------------------------- 000 0 No perms * 001 1 eXecute 010 2 Write 011 3 Write,eXecute 100 4 Read * 101 5 Read,eXecute * 110 6 Read,Write * 111 7 Read,Write,eXecute * 755 - common for s/w ( programs ) 644 - common for text files/documents/pictures/whatever 2) Using an english interpretation # chmod u+rw,g-w,o=r /tmp/test User (u) Group(g) Other(o) u,g,o +,-,= r,w,x You can list multiple modifications by separating them with commas