Installation guide

Chapter 11. Shell Prompt Basics 121
If you do not allow others to have execute permission to tigger, it will not matter who has read or
write access. No one will be able to get into the directory unless they know the exact filename they
want.
For example, type:
chmod a-x tigger
to remove everyone’s execute permissions.
Here is what happens now when you try to cd to into tigger:
[sam@halloween sam]$cd tigger
bash: tigger: Permission denied
[sam@halloween sam]$
Next, restore your own and your group’s access.
chmod ug+x tigger
Now, if you check your work with ls -dl you will see that only others will be denied access to the
tigger directory.
11.14.2. Changing Permissions With Numbers
Remember the reference to the shorthand method of chmod? Here is another way to change permis-
sions, although it may seem a little complex at first.
Go back to the original permissions for sneakers.txt (type ls -l sneakers.txt ).
-rw-rw-r-- 1 sam sam 150 Mar 19 08:08 sneakers.txt
Each permission setting can be represented by a numerical value:
r = 4
w = 2
x = 1
- = 0
When these values are added together, the total is used to set specific permissions. For example, if you
want read and write permissions, you would have a value of 6; 4 (read) + 2 (write) = 6.
For sneakers.txt, here are the numerical permissions settings:
- (rw-) (rw-) (r--)
| | |
4+2+0 4+2+0 4+0+0
The total for the user is six, the total for the group is six, and the total for others is four. The permissions
setting is read as 664.
If you want to change sneakers.txt so those in your group will not have write access, but can still
read the file, remove the access by subtracting two (2) from that set of numbers.
The numerical values, then, would become six, four, and four (644).
To implement these new settings, type: