The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
grep unix.com with google



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Reply
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-23-2009
Registered User
 

Join Date: Jul 2009
Posts: 7
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

Last edited by funyotros; 12-11-2009 at 09:36 PM..
  #2 (permalink)  
Old 11-23-2009
jgt's Avatar
jgt jgt is online now
Registered User
 

Join Date: Apr 2007
Location: 44.21.48N 80.50.15W
Posts: 544
Can the users add files from a command prompt, or are the files created as a result of running a program or script?
  #3 (permalink)  
Old 11-23-2009
Registered User
 

Join Date: Jul 2009
Posts: 7
Both(?)
I've got people acceding the folder and creating files locally and via samba network.
  #4 (permalink)  
Old 11-25-2009
jgt's Avatar
jgt jgt is online now
Registered User
 

Join Date: Apr 2007
Location: 44.21.48N 80.50.15W
Posts: 544
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 (permalink)  
Old 12-11-2009
Registered User
 

Join Date: Jul 2009
Posts: 7
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.
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Search for a file in specific directory jadoo_c2 Shell Programming and Scripting 2 10-26-2009 12:04 PM
when FTP user will go to specific directory thepurple SUN Solaris 5 12-22-2008 10:15 AM
How to find a specific files in a many directory selamba_warrior Shell Programming and Scripting 7 05-28-2008 04:41 PM
how to install rpm to specific directory beeloo UNIX for Dummies Questions & Answers 2 05-21-2008 01:02 PM



All times are GMT -4. The time now is 02:26 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0