
Before creating the directory, use the
umask
command to define which access permis-
sions should be masked each time a file object is created. The command
umask 027
sets the default permissions by giving the owner the full range of permissions (
0
),
denying the group write access (
2
), and giving other users no permissions at all (
7
).
umask
actually masks the corresponding permission bits or turns them off. For details,
consult the
umask
man page.
mkdir mydir
creates the
mydir
directory with the default permissions as set by
umask
. Use
ls -dl mydir
to check whether all permissions were assigned correctly.
The output for this example is:
drwxr-x--- ... tux project3 ... mydir
With
getfacl mydir
, check the initial state of the ACL. This gives information
like:
# file: mydir
# owner: tux
# group: project3
user::rwx
group::r-x
other::---
The first three output lines display the name, owner, and owning group of the directory.
The next three lines contain the three ACL entries owner, owning group, and other. In
fact, in the case of this minimum ACL, the
getfacl
command does not produce any
information you could not have obtained with
ls
.
Modify the ACL to assign read, write, and execute permissions to an additional user
geeko
and an additional group
mascots
with:
setfacl -m user:geeko:rwx,group:mascots:rwx mydir
The option
-m
prompts
setfacl
to modify the existing ACL. The following argument
indicates the ACL entries to modify (multiple entries are separated by commas). The
final part specifies the name of the directory to which these modifications should be
applied. Use the
getfacl
command to take a look at the resulting ACL.
# file: mydir
# owner: tux
# group: project3
Access Control Lists in Linux
287
Содержание LINUX ENTERPRISE SERVER 10 - INSTALLATION AND ADMINISTRATION 11-05-2007
Страница 1: ...SUSE Linux Enterprise Server www novell com 10 May 11 2007 Installation and Administration...
Страница 14: ......
Страница 19: ...Part I Deployment...
Страница 20: ......
Страница 60: ......
Страница 128: ......
Страница 243: ...Part II Administration...
Страница 244: ......
Страница 274: ......
Страница 312: ......
Страница 348: ......
Страница 380: ......
Страница 381: ...Part III System...
Страница 382: ......
Страница 438: ......
Страница 452: ......
Страница 478: ......
Страница 486: ......
Страница 498: ......
Страница 512: ......
Страница 558: ......
Страница 559: ...Part IV Services...
Страница 560: ......
Страница 652: ......
Страница 670: ......
Страница 742: ......
Страница 754: ......
Страница 796: ......
Страница 817: ...Part V Security...
Страница 818: ......
Страница 858: ......
Страница 886: ......
Страница 910: ......
Страница 911: ...Part VI Troubleshooting...
Страница 912: ......
Страница 924: ......