LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-23-2018, 09:56 AM   #1
mtlhd
Member
 
Registered: Sep 2007
Location: Florida
Distribution: Raspbian, Debian, CentOS, Ubuntu
Posts: 131

Rep: Reputation: 18
Question File being sent by service with permission 600, can umask, setuid, setgid override this?


Hello Linux Power Users,

We have a service sending our server a file with a certain permission we would like to change.

Will setting a umask on a folder have any power over what the set permission of the files is coming in?
The service that drops the file in the directory with a set permission of 600.
We would like to change this to 655.

Can we set a umask, or even perhaps setgid on the directory in question to override this?

tested umask u+rwx,go+rx

Currently we are having no luck. Are we stuck and have to have the service change the permissions they are sending?

Thanks in advance.

Cheers!
 
Old 01-23-2018, 12:11 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,777

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
You can't do it with umask since that only removes permissions. Setting the SETGID flag on the directory would cause new files to inherit the GID of the directory, but won't affect the (lack of) group permissions.

The only solution that comes to mind is to set a "default" ACL on the directory that grants the needed permissions. That default ACL is inherited by new files. You can puzzle over the manpages for setfacl and getfacl for details, but you're going to need something like
Code:
setfacl --set d:u::rw /path/to/directory
setfacl -m d:g:{groupname}:rx /path/to/directory
setfacl -m d:other:rx /path/to/directory
Replace "{groupname}" with the appropriate group name or numeric GID. The word "other" is literal.
 
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
setuid, setgid, sticky bit vincix Linux - Newbie 14 01-09-2015 04:02 PM
SETUID & SETGID Problem ppartyka Linux - Security 2 02-21-2013 01:27 PM
Do all these files really need setuid/setgid? jenhu Linux - Security 4 08-03-2008 04:49 AM
setuid + setgid files... jd32 Linux - Security 2 10-16-2004 11:10 AM
Permissions (Setuid, Setgid, etc) Please help MelLinux Linux - General 1 10-18-2002 11:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:04 AM.

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