LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-18-2013, 07:23 PM   #1
tlb944
LQ Newbie
 
Registered: Sep 2013
Posts: 1

Rep: Reputation: Disabled
Changing permissions for new files, but only for one directory


I have a customer requirement that is giving me a tough time. I have a shared volume between three servers (locally mounted to one and NFS mounted to the others). The two NFS mounted servers have the Xuser user reading and writing files into the shared directory. On the third server, there is user Yuser who is also reading and writing files in the directory. Sometimes files written by Yuser will be updated by files written by Xuser. Maybe vice versa, but not sure. Both users are in the same 'grp1' group with the same group id on all three servers. The Xuser and Yuser UIDs are different. Problem is, the umask for both users is 0022. New files created by both users have 755 permissions (o:rw,g:r,w:r) on each file created. Even though both users have write permissions to the directory, they don't have write permission to the files. We don't want to change the umask for the users, because that creates vulnerabilities for too many files in other directories. How do we change the directory such that any new file created in the directory has 664 permissions?

This is what we get when the two users create files. This is good everywhere except for within the problem directory.
-rw-r--r-- 1 Xuser grp1 0 Sep 18 20:11 Xuser_created
-rw-r--r-- 1 Yuser grp1 0 Sep 18 20:10 Yuser_created

This is what we want when the two users create files in the directory, but only in this directory:
-rw-rw-r-- 1 Xuser grp1 0 Sep 18 20:11 Xuser_created
-rw-rw-r-- 1 Yuser grp1 0 Sep 18 20:10 Yuser_created

Thank you.
 
Old 09-20-2013, 11:22 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
They're both in the same group, you could change the umask to 0012. Yes, I realize you said you don't want to do that. There are some possibilities to use extended ACLs, but I don't know how to accomplish that as well as just changing the umask.
 
Old 10-03-2013, 09:07 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Yeah, ACLs is the way to go
Code:
setfacl -m d:u:username:rw dirname
 
1 members found this post helpful.
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
changing directory permissions . jay.singh Linux - Newbie 11 03-28-2013 09:59 AM
Changing directory and file permissions annec0010 Linux - Newbie 3 04-18-2012 02:16 PM
Changing Directory Permissions trevor4706 Fedora 2 06-13-2006 06:37 PM
Changing file permissions within a directory for all files. cajunaggie Linux - Newbie 2 02-06-2005 01:53 AM
Changing directory permissions Bagsy Linux - Newbie 1 07-08-2003 05:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration