Setting up existing Directories using facls to recursively add an individual user


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Setting up existing Directories using facls to recursively add an individual user
# 1  
Old 03-30-2011
Setting up existing Directories using facls to recursively add an individual user

I've been working with Solaris/Linux for about 4 months now. Let me explain the scenario. There will be two users involved. The owner (curOwner) and the new user (newUser). The server in question is a Solaris 10 box.

So curOwner runs an application that is constantly writing logs to lets say.
Code:
/opt/apps/log

In the directory exists various logs of all sorts. All owned by curOwner. The application is constantly writing logs to the directory so it's important that none of curOwners rights are disturbed.

I need newUser to have the ability to "rwx" all current and future files under opt/apps/log directory(and ONLY the 'log'" directory). From what i understand there are multiple entries i have to make using the find command and setfacls. I'm struggling with getting it to take the setfacls command in conjunction with find.
Code:
find log -type f -exec setfacl -s u::rw-,g::r--,o:r--,g::rw-,m:rw- {} \;

find log -type d -exec setfacl -s u::rwx,g::r-x,o:r-x,m:rwx,d:u::rwx,d:g::r-x,d:o:r-x,d:m:rwx {} \;

find log -type d -exec setfacl -m group::rwx,d:g::rwx {} \;

From what i understand i need to run these three lines in conjunction to first set the dir and file access lists. Then make the files under the directory always inherit the proper rights. Yet i can't seem to dicipher what i'd need to do in order to make only newUser have the appropriate rights without disrupting curOwner. Can anyone help?

---------- Post updated at 08:35 PM ---------- Previous update was at 05:21 PM ----------

Did i frame this question incorrectly? Are there alternatives from using facls? Any input would be great.

Last edited by Scott; 03-30-2011 at 06:31 PM.. Reason: Please use code tags
# 2  
Old 03-30-2011
Can you create a new group to add both curOwner and newUser in it?

When curOwner create a new log, default permission will be 664. So both accounts can read and update the log files.

But the thing confused me is, why you need other accounts to update log files? Read-only permission is not enought?
# 3  
Old 03-31-2011
newUser will be deleting Old logs after moving them.

---------- Post updated at 09:57 AM ---------- Previous update was at 07:58 AM ----------

Figured it out. Can't believe i didn't see it. Say newUser is in group newUser.


Code:
find log -type f -exec setfacl -s u::rw-,g::r--,o:r--,g:newUser:rwx,m:rw- {} \;
find log -type d -exec setfacl -s u::rwx,g::r-x,o:r-x,m:rwx,d:u::rwx,d:g::r-x,d:o:r-x,d:m:rwx {} \;
find log -type d -exec setfacl -m group:newUser:rwx,d:g:newUser:rwx {} \;

 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Recursively Searcing file in the directories

i have directory dgf in the dgf( some other Sub-dir are there) 00 01 02 03 04 in all the Sub directory there is a SG.csv .. i want the scripts should run one by one Sub-dir and print the result for that particular Sub-dir ..then go to next Sub-Dir and print the result....... please... (6 Replies)
Discussion started by: Aditya.Gurgaon
6 Replies

2. Shell Programming and Scripting

Recursively rename directories

I have this directory tree under /apps/myapp/data: imageshack.us/photo/my-images/703/foldersc.png How to recursively rename ONLY directories with 5 digits (00000, 00100, 00200,..., 00007, 00107,...)? I want to add to their name two more zeros: Before: 00107 After: 0000107 Thanks in... (2 Replies)
Discussion started by: Susan_45
2 Replies

3. UNIX for Dummies Questions & Answers

List directories and sub directories recursively excluding files

Hi, Please help me, how to get all the direcotries, its sub directories and its sub directories recursively, need to exclude all the files in the process. I wanted to disply using a unix command all the directories recursively excluding files. I tried 'ls -FR' but that display files as... (3 Replies)
Discussion started by: pointers
3 Replies

4. UNIX for Advanced & Expert Users

Recursively delete only specified directories with given pattern

Hi All, We have a requirement to recursively delete the directories and its subdirectories older than 60 days based on timestamp (folder creation timestamp)under certain directory. However it has some specific requirements. The directories will continue to be there upto any depth. the... (0 Replies)
Discussion started by: rcvasu
0 Replies

5. Shell Programming and Scripting

Finding directory and sub-directories individual size in Perl

Hi, Can anyone redirect to an existing thread or provide some info on how to find the size of a directory and it's sub-directories using a single script ? I tried finding a similar thread but in vain. I'm a newbie and any help would be greatly appreciated. Thanks in advance. (3 Replies)
Discussion started by: ryder
3 Replies

6. Shell Programming and Scripting

Shell script to execute commands in individual users' home directories

Hi, I am trying to write a shell script which execute certain commands within certain folders in each user's home directories I started off with a bash script - #!/bin/csh -f su -l cvsusr1 cvs -d /home/cvsadm/repository status But the shell script finishes immediately after... (1 Reply)
Discussion started by: rupa_lahiri
1 Replies

7. Solaris

Add existing user into an existing group

Pre: no gpasswd/adduser there is just usermod can be used, also there is no -a option for usermod. How should I add a user into a group? (4 Replies)
Discussion started by: a2156z
4 Replies

8. UNIX for Dummies Questions & Answers

How to display directories recursively?

Cannot find how to list the directory structure of a volume recursively. Do not want the files reported. Say I have 100 directories and 10,000 files, I do not want 10,000 lines of output. (If this is relevant, I am using the terminal on my OSX Mac). I hope this is easy - there should be an easy... (5 Replies)
Discussion started by: jwriter
5 Replies

9. UNIX for Dummies Questions & Answers

Recursively deleting directories

Say I have a directory call test, and several directories nested in it, and several directories nested in them. And I want to remove all directories within "test" and its subdirectories that have the name "cvs", how can I do this? I tried rm -r cvs, but that only removed the top level direcotry... (4 Replies)
Discussion started by: mikeshank
4 Replies
Login or Register to Ask a Question