Umask a specific directory


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Umask a specific directory
# 1  
Old 11-23-2009
Question Umask a specific directory

Is there a way to umask only a specific directory?
I want that everyone who add a NEW file in this folder gets its file moded 700. But that adding it in any other folder still moded as default.

Excuse my poor English! I'm not a native speaker
Thanks in advance Image

Last edited by funyotros; 12-11-2009 at 09:36 PM..
# 2  
Old 11-23-2009
Can the users add files from a command prompt, or are the files created as a result of running a program or script?
# 3  
Old 11-23-2009
Both(?)
I've got people acceding the folder and creating files locally and via samba network.
# 4  
Old 11-25-2009
The files saved though samba can be set to 0700 by setting the mask in the samba configuration file (/etc/samba/smb.conf ?).
For users with access to a command prompt, I suppose you could make their .profile read only, set their umask to 0700 and move chmod to a directory outside of their PATH
Set the sticky bit in the parent folder (chmod +t directory_name), so that only the owner of the directory can delete it.
# 5  
Old 12-11-2009
I've solved using access control lists. man setaclf

Quote:
setfacl -d -m g:riskyusers:r mypreciousdir
Set read only perms to any new file created in mypreciousdir by a member of the riskyusers group.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Download and extract to a specific directory

Trying to download and extract a file to a specific folder, but getting an error. What am I doing wrong? Is there a way to rename the download if desired? Thank you :). curl --url https://github.com/arq5x/bedtools2/releases/download/v2.26.0/bedtools-2.26.0.tar.gz | tar -xz --output... (4 Replies)
Discussion started by: cmccabe
4 Replies

2. UNIX for Dummies Questions & Answers

How to search in specific directory using find?

Hi, Is there any way to use find command and search only specific subdirectories in a directory. for example /home/d1 /home/d2 /home/d3 i want to search in the following directories /home /home/d1 /home/d2 i do not want the find command to search the /home/d3 directory. (6 Replies)
Discussion started by: Little
6 Replies

3. Shell Programming and Scripting

Shell scripting-I need a script which should watch a directory for a file with specific directory

I need a script which should watch a directory for a file with specific directory. If it finds a file in directory, it should search for few specific keyword in the file. if the keyword exists, it should trim string from specific column. The file should be moved to another directory and the a... (8 Replies)
Discussion started by: akashdeepak
8 Replies

4. Shell Programming and Scripting

How to copy a directory without specific files?

Hi I need to copy a huge directory with thousands of files onto another directory but without *.WMV files (and without *.wmv - perhaps we need to use *.). Pls advise how can I do that. Thanks (17 Replies)
Discussion started by: reddyr
17 Replies

5. Web Development

Directory index forbidden by Options directive error on specific directory with indexing disabled

I am seeing the following error appear numerous times in my Apache error log: I have my Apache config configured as below, so I would expect indexing not to occur on this directory as it falls under the parent /web directory. Strangely all the IP address, including this example, all... (5 Replies)
Discussion started by: crmpicco
5 Replies

6. UNIX for Dummies Questions & Answers

How to search directory for specific file?

I am new to Unix scripting and would like some help. Here is my scenario: 1) I have a text files that contains two fields: file name and retention period in months: File1 36 file2 24 File3 12 2) The directory I am searching contains sequential files. 3) I need to be able to take the file name... (10 Replies)
Discussion started by: Mustafa19804
10 Replies

7. Shell Programming and Scripting

Specific directory parsing in a directory tree

Hi friends, Hello again :) i got stuck in problem. Is there any way to get a special directory from directory tree? Here is my problm.." Suppose i have one fix directory structure "/abc/xyz/pqr/"(this will be fix).Under this directory structure i have some other directory and... (6 Replies)
Discussion started by: harpal singh
6 Replies

8. UNIX for Advanced & Expert Users

allow user to use sudo cp on a specific directory and only a specific file

Is there a way to allow a user to use sudo cp on a specific directory and only a specific file? (6 Replies)
Discussion started by: cokedude
6 Replies

9. UNIX for Dummies Questions & Answers

how to install rpm to specific directory

Hi, For example, I want to install abc.rpm to /abc directory. How can I do that? Please help. (2 Replies)
Discussion started by: beeloo
2 Replies

10. Shell Programming and Scripting

count file(s) under a specific directory

How do I count number of file in a directory. Here is what I want to do. 1. find total number of file in a directory in variable total 2. ftp all the file 3. ftp_return_code=`grep -c "Transfer complete" $logfile` if then exit 0 else exit -1 fi (6 Replies)
Discussion started by: leemjesse
6 Replies
Login or Register to Ask a Question