Ownership And Permissions - Red Hat ENTERPRISE LINUX 3 - STEP BY STEP GUIDE Manual

Table of Contents

Advertisement

Chapter 3. Shell Prompt Basics
41

3.13. Ownership and Permissions

Earlier in this chapter, when you tried to change to root's login directory, you received the following
message:
-bash: cd: /root/: Permission denied
That was one demonstration of Linux's security features. Linux, like UNIX, is a multi-user system
and file permissions are one way the system protects against malicious tampering.
One way to gain entry when you are denied permission is to
to root, as you learned earlier. This
su -
is because whoever knows the root password has complete access.
But switching to the superuser is not always convenient or recommended, since it is easy to make
mistakes and alter important configuration files as the superuser.
All files and directories are "owned" by the person who created them. You created the file
(refer to Section 3.8.1 Using Redirection) in your login directory, so
sneakers.txt
belongs to you.
sneakers.txt
That means you can specify who is allowed to read the file, write to the file, or (if it is an application
instead of a text file) who can execute the file.
Reading, writing, and executing are the three main settings in permissions. Since users are placed into
a group when their accounts are created, you can also specify whether certain groups can read, write
to, or execute a file.
Take a closer look at
with the
command using the
option (refer to Figure 3-11).
sneakers.txt
ls
-l
There is a lot of detail provided here. You can see who can read (r) and write to (w) the file, as well as
who created the file (sam), and to which group the owner belongs (sam). Remember that, by default,
the name of your group is the same as your login name.
Figure 3-11. Permissions for
sneakers.txt
Other information to the right of the group includes file size, date and time of file creation, and file
name.
The first column shows current permissions; it has ten slots. The first slot represents the type of file.
The remaining nine slots are actually three sets of permissions for three different categories of users.
For example:
-rw-rw-r--

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 3

Table of Contents