26.10.2012 Views

SUSE LINUX Documentation - Index of

SUSE LINUX Documentation - Index of

SUSE LINUX Documentation - Index of

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.2.2 Modifying File Permissions<br />

Changing Access Permissions<br />

The access permissions <strong>of</strong> a file or directory can be changed by the owner and, <strong>of</strong><br />

course, by root with the command chmod followed by the parameters changing<br />

the permissions and one or more filenames. The parameters form different categories:<br />

1. Users concerned<br />

• u (user)—owner <strong>of</strong> the file<br />

• g (group)—group that owns the file<br />

• o (others)—additional users (if no parameter is given, the changes apply to all<br />

categories)<br />

2. A character for deletion (–), setting (=), or insertion (+)<br />

3. The abbreviations<br />

• r—read<br />

• w—write<br />

• x—execute<br />

4. Filename or filenames separated by spaces<br />

If, for example, the user tux in Example 3.2, “Sample Output Showing Directory<br />

Permissions” (page 104) also wants to grant other users write (w) access to the directory<br />

ProjectData, he can do this using the command chmod o+w<br />

ProjectData.<br />

If, however, he wants to deny all users other than himself write permissions, he<br />

can do this by entering the command chmod go-w ProjectData. To prohibit<br />

all users from adding a new file to the folder ProjectData, enter chmod -w<br />

ProjectData. Now, not even the owner can create a new file in the directory<br />

without first reestablishing write permissions.<br />

Working with the Shell 105

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!