1836593 Members
3231 Online
110102 Solutions
New Discussion

Re: File permission

 
Noble Sebastian
Frequent Advisor

File permission

Hi,

friends

I want set permission to directory

Eg:
A, B, C, D directory

A is parent directory
B sub of A
C sub of B
D sub of C
All directory is have lot of files

All files and directory are owner of user user1;
I want give permission to another user user2 also


So I try
Setacl –m user: user2: rwx A
But this permission A only, Not inside of sub directory and files

Any one tells me, any command for all directory and files permission setting …..?

Thanks
Noble
5 REPLIES 5
Dennis Handly
Acclaimed Contributor

Re: File permission

I don't see any -R option. You'll need to do:
$ setacl -m user: user2: rwx A A/* A/B/* A/B/C/* A/B/C/D/*
Oviwan
Honored Contributor

Re: File permission

or if there is too much work, create a new group for user1 and user2. then
$chgrp -R newgroupname A
Court Campbell
Honored Contributor

Re: File permission

try this

# getacl A > aclfile

then

# find A -exec setacl -f aclfile {} \;

If you output the getacl to a file you can then use it with setacl to copy the acl's.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Noble Sebastian
Frequent Advisor

Re: File permission

Hi
Dennis Handly


This not A,B,C,D directory
thousands of directorys and files here

so any another method can u tell me ....


thanks
Noble
Dennis Handly
Acclaimed Contributor

Re: File permission

>thousands of directories and files here

1000s don't matter if they fit on one command. If you have a fixed directory depth, you can use */* and deeper.

Otherwise you'll have to use find as Court suggested. Except use "+":
# find A -exec setacl -f aclfile {} +