18.12.2012 Views

O'Reilly - Practical UNIX & Internet Sec... 7015KB

O'Reilly - Practical UNIX & Internet Sec... 7015KB

O'Reilly - Practical UNIX & Internet Sec... 7015KB

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

[Chapter 5] 5.2 Using File Permissions<br />

% ls -l *.c<br />

-rw-r--r-- 1 kevin okisrc 28092 Aug 9 9:52 cdrom.c<br />

-rw-r--r-- 1 kevin okisrc 5496 Aug 9 9:52 cfs_subr.c<br />

-rw-r--r-- 1 kevin okisrc 5752 Aug 9 9:52 cfs_vfsops.c<br />

-rw-r--r-- 1 kevin okisrc 11998 Aug 9 9:53 cfs_vnodeops.c<br />

-rw-r--r-- 1 kevin okisrc 3031 Aug 9 9:53 load_unld.c<br />

-rw-r--r-- 1 kevin okisrc 1928 Aug 9 9:54 Unix_rw.c<br />

-rw-r--r-- 1 kevin okisrc 153 Aug 9 9:54 vers.c<br />

%<br />

To change the permissions of a file so it can be read or modified by anybody in your group, but can't be read or written by<br />

anybody else in the system, type the command:<br />

% chmod 660 memberlist<br />

% ls -l memberlist<br />

-rw-rw---- 1 kevin okisrc 153 Aug 10 8:32 memberlist<br />

%<br />

5.2.5 Access Control Lists[17]<br />

[17] This section is largely based on Æleen Frisch's Essential System Administration, <strong>Sec</strong>ond Edition (<strong>O'Reilly</strong> &<br />

Associates, 1995), Chapter 6, and is used here with permission.<br />

Some versions of <strong>UNIX</strong> support Access Control Lists, or ACLS. These are normally provided as an extension to standard <strong>UNIX</strong><br />

file permission modes. With ACLS, you can specify additional access rights to each file and directory for many individual users<br />

rather than lumping them all into the category "other." You can also set different permissions for members of different groups.<br />

We think they are a wonderful feature, and something we will see more of in future years. Unfortunately, every vendor has<br />

implemented them differently, and this makes describing them somewhat complex.<br />

ACLS offer a further refinement to the standard <strong>UNIX</strong> file permissions capabilities. ACLS enable you to specify file access for<br />

completely arbitrary subsets of users and/or groups. Both AIX and HP-UX provide access control lists. Solaris and Linux are<br />

supposed to have them in future releases. Also, the Open Software Foundation's Distributed Computing Environment has a form<br />

of ACLS.<br />

For many purposes, ACLS are superior to the <strong>UNIX</strong> group mechanism for small collaborative projects. If Hana wants to give<br />

Miria - and only Miria - access to a particular file, Hana can modify the file's ACL to give Miria access. Without ACLS, Hana<br />

would have to go to the system administrator, have a new group created that contains both Hana and Miria (and only Hana and<br />

Miria) as group members, and then change the group of the file to the newly created group.<br />

NOTE: Because ACLS are not standard across <strong>UNIX</strong> versions, you should not expect them to work in a network<br />

filesystem environment. In particular, Sun plans to support ACLS through the use of private extensions to the NFS3<br />

filesystem, rather than building ACLS into the specification. Therefore, be sure that anything you export via NFS is<br />

adequately protected by the default <strong>UNIX</strong> file permissions and ownership settings.<br />

5.2.5.1 AIX Access Control Lists<br />

An AIX ACL contains these fields (the text in italics to the right describes the line contents):<br />

attributes: Special modes like SUID.<br />

base permissions Normal <strong>UNIX</strong> file modes:<br />

owner(chavez): rw- User access.<br />

group(chem): rw- Group access.<br />

others: r-- Other access.<br />

extended permissions More specific permissions entries:<br />

enabled Whether they're used or not.<br />

specify r-- u:harvey Permissions for user harvey.<br />

deny -w- g:organic Permissions for group organic.<br />

permit rw- u:hill, g:bio Permissions for user hill when in group<br />

file:///C|/Oreilly Unix etc/<strong>O'Reilly</strong> Reference Library/networking/puis/ch05_02.htm (5 of 9) [2002-04-12 10:44:09]

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

Saved successfully!

Ooh no, something went wrong!