LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   setting ACL recursively (https://www.linuxquestions.org/questions/linux-newbie-8/setting-acl-recursively-4175435837/)

amar.sree 11-05-2012 11:34 PM

setting ACL recursively
 
Hi All,

I was trying to set ACLS to folder recursively.
i had a folder /u02/adkv_objects with permissions set to 755

i had a user and i need to give him rwx to the folder recursively for existing files and for newly crating files and folders.

i have set acl by:
setfacl -R -m u:ghosh:rwx /u02/adkv_objects.

by ruuning the above commands folder permissions changed to 775 and user ghosh also not able to write in that folder.
getfacl output:
[root@LCORUPMDW01 adkv_objects]# getfacl /u02/adkv_objects
getfacl: Removing leading '/' from absolute path names
# file: u02/adkv_objects
# owner: oracle
# group: dba
user::rwx
user:ghosh:rwx #effective:r-x
group::rwx #effective:r-x
mask::r-x
other::r-x

[root@LCORUPMDW01 adkv_objects]#



pls share your suggestion for completing the task


Amar

v11pandey 11-06-2012 12:19 AM

Hi
 
Hi amar,

you have used right command to set acl recursive for a folder, and it will change the folder permission to 755.
As per your command since ghosh is getting the user access for the folder he should be able to right in that.

Permission given by ACL command used by you will flow recursive to all sub folders and file under that folder.
But for newly created file or folder beneath parent folder acl permission will be different than you have set on Parent one.
To make active on newly created file you will have to run the same acl command you have used on the parent folder.

amar.sree 11-06-2012 12:26 AM

hi Pandey,
Thanks for the reply.

Every thing seems to be right but the user cant write in any of the folders and he is getting permission denied.

[root@LCORUPMDW01 u02]# getfacl adkv_objects
# file: adkv_objects
# owner: oracle
# group: dba
user::rwx
user:ghosh:rwx #effective:r-x
group::rwx #effective:r-x
mask::r-x
other::r-x


user:ghosh:rwx #effective:r-x althought it was showing full permission he cant write that was the bothering thing

and after setting acl permission changing from 755 to 775. it was another thing.


Amar

chrism01 11-06-2012 12:28 AM

Actually, to have it affect future files, you need 'd'
Quote:

• Automatic ACL setting
• New files inherit default ACL (if set) from directory
• setfacl -m d:u:frodo:rw directory

v11pandey 11-06-2012 06:05 AM

Hi Amar,
 
First remove the acl permission that you have set for adkv_objects by using below command
setfacl -b adkv_objects


then set acl by using command below
setfacl -m d:u:ghosh:rwx adkv_objects

By this you problem should be solved as below
1)Change of directory permisson to 775.
2)User ghosh was unable to right.

//
Regards
Vivek


All times are GMT -5. The time now is 01:33 PM.