MAL - Memória Auxiliar do Lutieri

domingo, outubro 02, 2011

Playing with ACLs on File Systems

Enabling ACLs:
# mount -oremount,acl /


Before:
[root@zeus ~]# ll
total 20
-rw-------. 1 root root 1134 Oct 2 14:13 anaconda-ks.cfg
-rw-r--r--. 1 root root 8408 Oct 2 14:13 install.log
-rw-r--r--. 1 root root 3164 Oct 2 14:12 install.log.syslog
[root@zeus ~]# getfacl install.log
# file: install.log
# owner: root
# group: root
user::rw-
group::r--
other::r--


Giving user01 rwx permissions on install.log
[root@zeus ~]# setfacl -m u:user01:rwx install.log

After:
[root@zeus ~]# ll
total 24
-rw-------. 1 root root 1134 Oct 2 14:13 anaconda-ks.cfg
-rw-rwxr--+ 1 root root 8408 Oct 2 14:13 install.log
-rw-r--r--. 1 root root 3164 Oct 2 14:12 install.log.syslog
[root@zeus ~]# getfacl install.log
# file: install.log
# owner: root
# group: root
user::rw-
user:user01:rwx
group::r--
mask::rwx
other::r--

Removing the previous gaven permission:

[root@zeus ~]# setfacl -x u:user01 install.log
[root@zeus ~]# getfacl install.log
# file: install.log
# owner: root
# group: root
user::rw-
group::r--
mask::r--
other::r--


Assigning and removing multiple entries:
[user01@zeus ~]$ setfacl -m u:root:rw-,u:games:r-- a
[user01@zeus ~]$ getfacl a
# file: a
# owner: user01
# group: user01
user::rw-
user:root:rw-
user:games:r--
group::rw-
mask::rw-
other::r--
[user01@zeus ~]$ setfacl  -b a
[user01@zeus ~]$ getfacl a
# file: a
# owner: user01
# group: user01
user::rw-
group::rw-
other::r--

0 Comentários:

Postar um comentário

<< Home



Chat with Lutieri G. B.

Subscribe in a reader