new directory - how to force files created in it to inherit grp,own and permissions


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers new directory - how to force files created in it to inherit grp,own and permissions
# 1  
Old 04-26-2002
new directory - how to force files created in it to inherit grp,own and permissions

Hi, I'm new to unix -solaris.

I've just upgraded a third party software product and am testing
it to see if new files created in a test database directory were being created properly and they aren't. They're owned by the user that created the file, instead of poppa and the group of their files is not always momma - see below..

I created a directory and set owner, group and permissions on it as follows :

mkdir /tempdb
chown poppa tempdb
chgrp momma tempdb
chmod 660 tempdb

My question is - how do I force files created in this directory to inherit the owner and group and permissions of the directory itself ?

All users with access to log in to this sun box will need to share these files.

Thanks in advance if anyone can help me.
Is it umask I need or setacl ?
I've read the umask man page but it's a bit confusing.
# 2  
Old 04-26-2002
/etc/group and umask

__________________________
An easy way to solve this is to add the users who will share these files to the group that it application user is a member of.

If the default group is oracle, then make all the users a member of the group oracle in /etc/group...

IF you want everyone to have permissions in the poppa dir, give them a secondary group of momma in /etc/group.
Also, make sure the group rights are such that users can read/write files in the specified dir.

___________________________
Umask can be modified in the .profile of the specified user. It i will give the opposite of what you set the umask to for new files and dirs created by that user...

If you set "umask 022" then the new file parms will be 644. Note that you cannot give executable permissions with umask. It will not do it even if you give umask 000...

Set umask 006, this will give you 660 for new file creation.
# 3  
Old 04-26-2002
The owner forget it, because is necesary to create an executable, or an script and can cause an exposure.

For the group

chmod g+s /tempdb

The user that create a file in /tempdb must be in the momma group.

Regards. Hugo
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Asking about the permission inherit from the parent directory

Asking about the permission inherit from the parent directory I am running the web app with tomcat8, I did use umask 007 to set permission for folder which enable the sub files and folder inherit the permission from the parent directory, I was successful which some directories but the directories... (2 Replies)
Discussion started by: janecaongoc
2 Replies

2. UNIX for Beginners Questions & Answers

Asking about the permission inherit from the parent directory

Asking about the permission inherit from the parent directory I am running the web app with tomcat8, I did use umask 007 to set permission for folder which enable the sub files and folder inherit the permission from the parent directory, I was successful which some directories but the directories... (1 Reply)
Discussion started by: janecaongoc
1 Replies

3. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

4. UNIX for Dummies Questions & Answers

How to find directory listing from root to all files in tree format with details of perm/own/grp?

Hi, My apologies if my query is already available on this forum but I am new and could not find. I need a script to list all directories/sub directories and files with permissions/groups/owners. The script would run from home directory and should capture every directory. How do I do this? ... (4 Replies)
Discussion started by: 8709711
4 Replies

5. Red Hat

Set permissions for new files created by application

Hello All, I have an application that creates the log files and they created with 600 permissions instead of 644(default). How can I set the permissions so that files can be created with 644. I looked into the /etc/profile for the umask settings and it is set 002(if UID>199). And when I type... (5 Replies)
Discussion started by: s_linux
5 Replies

6. UNIX for Advanced & Expert Users

Solaris files created within directory in last 15min.

I have a directory on a Solaris box that has 58 files written to it every 15min. They have a non standard date as part of the file name but always have another name with it. I need to check that directory for files created within the last 15min and then port the results to a log file. There are... (5 Replies)
Discussion started by: jlaigo2
5 Replies

7. Shell Programming and Scripting

How to find files created today in a particular directory?

Dear All, I want a Hp Ux command to find out the files created today in a particular directory or mountpoint. Kindly help. Thanks Bhaskar (10 Replies)
Discussion started by: sudiptabhaskar
10 Replies

8. UNIX for Advanced & Expert Users

files created with different permissions

Hi, Within a SQL file i am calling 5 shell scripts in back ground and redirecting their outputs to different log files in a specific directory. Now when I observed is, the log files are created with different permissions even though i did not do any thing specific. For example in... (2 Replies)
Discussion started by: steria_learner
2 Replies

9. UNIX for Dummies Questions & Answers

Newly created files default group and write permissions

Whenever I create a new file the group name is "dnn" and the file permissions are "-rw-r--r--". How do I get it so when I create files (with vi or other programs) that the default group is "sss" and the permissions are 770? (I am running HP-UNIX) Thanks, GoldFish (2 Replies)
Discussion started by: goldfish
2 Replies

10. UNIX for Dummies Questions & Answers

Find all files created by a specified user in a directory and its subdirectories

Is there a command or shell script which can be used for Finding all files created by a specified userid in a directory and its subdirectories. Say, I want to find all such files in directory /abc as well as in all the subdirectories such as /abc/xyz or /abc/xyz/pqr aqnd so on which was created... (5 Replies)
Discussion started by: abhilashnair
5 Replies
Login or Register to Ask a Question