DB's Cheat for UNIX Permissions
Thanks to Dragon's Bane for this tip!
DB's cheat for UNIX permissions
(AKA: If you can add to seven you got permissions licked ;)
There are three things to know about permissions:
1) Read
2) Write
3) Execute
Reading just means someone can read the info in the directory or the file
(ie: open it).
Write means they can write to the file or the directory.
Execute means they can run a script or run an application (ie: the file).
Not hard at all is it? Let's put them to work.
If you have a folder (know as directories in UNIX) and you want to be
able to read the stuff inside it as well as write to the files there -
but NOT be able to run any scripts - all you have to do is set the permissions
to read and write.
In UNIX there are three different types of users - each of which get the
permissions set:
- There is the "actual" user (that would be you)
- There is the "group" (people who belong to the users group)
- And the "other" (that would be everyone else (also incorrectly
known in Apple-speak as "everyone")).
So where do the problems come in? They don't - as long as you know how
to add to 7. (WHAT?!?!!?) Sure, just add to seven and you are done.
Read = 4
Write = 2
Execute = 1
Let's do some simple math.
0 = no read, write or execute - If you don't want anything, don't add
anything (that one was easy ;)
7 = read AND write AND execute
6 = read and write
5 = read and execute
4 = read (you knew that - just had to think about it :0
3 = write and execute
2 = write
1 = execute
COME ON DB!!! It is not that simple!!!
Oh yeah? Then what does 777 mean?
It means that user, group and everyone else can read and write and execute.
Oh.
And 755 means the user can do anything but the group and everyone else
can only read and execute (to run a script you must be able to read it
- so you must set the permissions to 5 instead of just 1).
666 means user, group and everyone else can read and write (but not execute)
- this is how public FTP directories are set.
Any question you have about permissions can be solved if you know how
to add to 7. So simple... so sweet ;)
|
|