Suse LINUX Professional 9.3 Update 00662644461625 User Manual

Product codes
00662644461625
Page of 304
19
W
or
king
with
the
Shell
change to the
ProjectData
directory (
x
), view the contents (
r
), and add
or delete files (
w
). The rest of the users, on the other hand, are given less ac-
cess. They may enter the directory (
x
) and browse through it (
r
), but not
insert any new files (
w
).
19.2.2
Modifying File Permissions
Changing Access Permissions
The access permissions of a file or directory
can be changed by the owner and, of course, by
root
with the command
chmod
followed by the parameters changing the permissions and one or
more filenames. The parameters form different categories:
1. users concerned
u
(user)—owner of the file
g
(group)—group that owns the file
o
(others)—additional users (if no parameter is given, the changes
apply to all categories)
2. a character for deletion (
-
), setting (
=
), or insertion (
+
)
3. the abbreviations
r
—read
w
—write
x
—execute
4. filename or filenames separated by spaces
If, for example, the user
tux
in Example 19.2 on the facing page also wants
to grant other users write (
w
) access to the directory
ProjectData
, he can
do this using the command
chmod o+w ProjectData
.
If, however, he wants to deny all users other than himself write per-
missions, he can do this by entering the command
chmod go-w
ProjectData
. To prohibit all users from adding a new file to the folder
ProjectData
, enter
chmod -w ProjectData
. Now, not even the owner
can write to the file without first reestablishing write permissions.
Changing Ownership Permissions
Other important commands to control
the ownership and permissions of the file system components are
chown
(change owner) and
chgrp
(change group). The command
chown
can be
used to transfer ownership of a file to another user. However, only
root
is
permitted to perform this change.
257
SUSE LINUX