341
Chapter 21:
Introduction to Linux Systems Administration
Each of these three-letter chunks is then grouped together three at a time. The first
chunk represents the permissions for the owner of the file, the second chunk represents
the permissions for the group of the file, and the last chunk represents the permissions
for all of the users on the system. Table 21-4 lists some common permission.
Permission
Numeric
Equivalent Meaning
-rw-------
600
The owner has read and write permissions. You want
this setting for most of your files
-rw-r--r--
644
The owner has read and write permissions. The group
and world have read-only permissions. Be sure that you
want to let other people read this file.
-rw-rw-rw-
666
Everyone has read and write permissions on a file. This
setting is bad. You don't want other people to be able to
change your files.
-rwx------
700
The owner has read, write, and execute permissions.
You want this setting for programs that you wish to run
(such as the file that results from compiling a C or C++
program).
-rwxr-xr-x
755
The owner has read, write, and execute permissions. The
rest of the world has read and execute permissions.
-rwxrwxrwx 777
Everyone has read, write, and execute privileges. Like
the 666 setting, this is bad.
-rwx--x--x
711
The owner has read, write, and execute permissions.
The rest of the world has execute-only permissions. This
setting is useful for programs that you want to let others
run but not copy.
drwx------
700
This is a directory created with the mkdir command.
Only the owner can read and write to this directory.
Note that all directories must have the executable bit set.
drwxr-xr-x
755
Only the owner can change this directory, but everyone
else can view its contents.
drwx--x--x
711
A handy trick is to use this setting when you need to
keep a directory world-readable, but you don't want
people to be able to list the files by running the ls
command. The setting enables users to read a directory
only if they know the filename that they want to retrieve.
Table 21-4.
Common File Permissions