Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 02-17-2014, 10:29 AM   #1
LQ Newbie
Registered: Feb 2012
Posts: 5

Rep: Reputation: Disabled
need to change ACL mask to r-x for files to be created in directory

files are being created in the /usr/*/*/*/user1 directory which has the acl as follows

# file: /usr/*/*/*/user1
# owner: user1# group: sftp

# file: /usr/*/*/*/user1/test
# owner: user1
# group: sftp
userpadm:rwx #effective:r--
group::rwx #effective:r--

# file: /usr/*/*/*/user1/test2
# owner: rpstockfile
# group: sftp

The user ppadm in the same group needs to be able to chmod the file that has been created by user1. I can see I have to change the mask on the files so it will need to be changed on the default ACL and will need to be recursive. I cannot find how to do this or if I am correct. Help please. I really appreciate it.
Old 02-17-2014, 10:39 AM   #2
Registered: Feb 2014
Location: Europe
Distribution: Debian, Mint, Arch (multiboot)
Posts: 90

Rep: Reputation: Disabled
You want sth like:

group a > internet
group b > local

and vice versa?
Old 02-17-2014, 11:03 AM   #3
LQ Newbie
Registered: Feb 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
no, I just want the users in the same group to be able to manipulate the permissions of the file right now, any file created has r-- permissions. I need the files created to have r-x permissions. Don't let the group "sftp" confuse it, it can be any group the owner belongs to. From what I have managed to find I just need to change the default ACL mask for file creation in that directory to rwx but I cannot find how. Can I do that? I have another server that does do it, I just don't know how.

I have tried using the following setfacl command
setfacl -m m:: /usr/*/*/*/user1
setfacl -d -m m:rwx: /usr/*/*/*/user1
and variations but I still keep getting errors

Last edited by faitrien; 02-18-2014 at 12:01 PM. Reason: update with what I've done
Old 02-21-2014, 08:33 AM   #4
LQ Veteran
Registered: May 2008
Posts: 5,699

Rep: Reputation: 3557Reputation: 3557Reputation: 3557Reputation: 3557Reputation: 3557Reputation: 3557Reputation: 3557Reputation: 3557Reputation: 3557Reputation: 3557Reputation: 3557
Only the 'owner' of a file or the superuser can change its permissions. Trying to use ACLs won't help. Also, default ACLs won't override permission that aren't in the mode specified in the open() call that creates the file, so if the program creating the file doesn't specify execute permissions at creation, you're not going to be able to force the permission bit to be set by any other method.

You've only got 2 options,

Use a vfat filesystem and mount it using something like uid=whatever,gid=whatever,dmask=007,fmask=007

But that's a bit ugly.

write a cron job that runs periodically and does a recursive chmod/chown on your chosen directory. But that's also a bit ugly.

Unfortunately when the guys designed the POSIX permissions system back in the 60's they didn't think that anyone would ever want a group, rather than an individual user to 'own' a file. Sorry to be the bearer of bad news.
Old 02-26-2014, 07:08 AM   #5
LQ Newbie
Registered: Jul 2008
Posts: 6

Rep: Reputation: 0
setfacl -R -d -m
To set default acl recursive


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Files to change IP, mask, and default gateway, & on a vsftp server rjo98 Linux - Newbie 13 02-04-2014 07:39 AM
strange files created in my home directory vandana agarwal Linux - General 1 05-15-2013 03:04 PM
Why does the ACL of a file created under a directory differ from the default ACL sctebnt Linux - Security 5 12-02-2011 09:13 AM
files are created in my /home directory sycamorex Linux - Security 3 08-02-2008 05:19 PM
Created new home directory and lost my files jnewby72 Linux - General 4 01-26-2006 12:25 AM > Forums > Linux Forums > Linux - Security

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

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