Permissões de arquivos utilizando getfacl e setfacl
Nos exemplos abaixo irei mostrar como utilizar os comandos getfacl e setfacl para controlar acls de permissões no Linux / Samba: admin@localhost ~]$ getfacl teste.txt # file: teste.txt # owner: admin # group: admin user::rw- group::rw- other::r--...
Nos exemplos abaixo irei mostrar como utilizar os comandos getfacl e setfacl para controlar acls de permissões no Linux / Samba:
admin@localhost ~]$ getfacl teste.txt
# file: teste.txt
# owner: admin
# group: admin
user::rw-
group::rw-
other::r--
Agora vamos atribuir poderes para o usuario sidon
[admin@localhost ~]$ setfacl -m user:Sidon:rw teste.txt
Vamos ver o que nos mostra getfacl:
[admin@localhost ~]$ getfacl teste.txt
# file: teste.txt
# owner: admin
# group: admin
user::rw-
user:Sidon:rw-
group::rw-
mask::rw-
other::r--
Tirando a leitura de "other"
[root@localhost admin]# setfacl -m o:--- teste.txt
O lque mostra getfacl:
[root@localhost admin]# getfacl teste.txt
# file: teste.txt
# owner: admin
# group: admin
user::rw-
user:Sidon:rw-
group::rw-
mask::rw-
other::---
Importante:
Para funcionar samba, inclua no smb.conf:
#acls
map acl inherit = yes
inherit acl = yes
inherit permissions = yes
André Jaccon