Datasheet

21
Working with the Shell
means the user tux as well as the members of the group project3 can
change to the ProjectData directory (x), view the contents (r), and add
new files to it (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).
21.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 file names. 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. file name or names separated by spaces
If, for example, the user tux in Example 21.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
267SUSE LINUX