LinuxQuestions.org
Review your favorite Linux distribution.
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 10-07-2014, 02:06 PM   #1
Kenneth Henry
LQ Newbie
 
Registered: Oct 2014
Distribution: Redhat7
Posts: 2

Rep: Reputation: Disabled
Permission Inheritance


I am trying to get new files to inherit their permissions from their parent directory. So, as a test, I created a directory and set desired permissions:

Code:
mkdir content
chmod 740 content
chown ken:dev content
Now, if I cd to the new directory and create a test file, I am expecting the file to have 740 permissions, but it doesn't.

Code:
cd content
> test.txt
ls -l

-rw-rw-r--. 1 root root 0 Oct  7 14:02 test.txt
What is causing the other:read access and how do I get rid of it?
 
Old 10-07-2014, 03:46 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Investigate two things:

umask
setuid/setgid



umask is an environment varaible that is set for every user and defines what permissions a new file/folder will get.

http://www.cyberciti.biz/tips/unders...lue-usage.html


Setuid/setgid is the 4 octal permission that allows you to provide inherit permissions in a way. All permissions are 4 digits in linux the first digit is assumed as a 0 if you only give it three.

chmod 740 is really chmod 0740.

http://www.techrepublic.com/blog/it-...rove-security/
 
Old 10-07-2014, 04:23 PM   #3
Kenneth Henry
LQ Newbie
 
Registered: Oct 2014
Distribution: Redhat7
Posts: 2

Original Poster
Rep: Reputation: Disabled
As a long time admin new to Linux this will require a little back up and rethink :-)

Thank you for the clear citations.
 
  


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
How permission inheritance really works? mozer Linux - Newbie 6 08-29-2014 05:59 AM
Folder/File permission inheritance. mikhail91 Linux - Newbie 1 01-07-2013 07:07 AM
[SOLVED] Permission inheritance via Samba adol83 Linux - Newbie 7 12-18-2012 03:01 AM
NFS: folder permission inheritance Swakoo Linux - General 5 06-25-2007 04:29 AM
File permission inheritance HowTo ? Satriani Linux - Security 4 11-26-2004 05:13 AM

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

All times are GMT -5. The time now is 11:14 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