?
Solved

Linux - Inherit directory permissions

Posted on 2003-03-10
6
Medium Priority
?
588 Views
Last Modified: 2013-12-15
Hi all!

I forgot how to chmod and chown a directory where all files and subdirectories inherit the permissions of the parent.  I want the Owner to Read, Write, Execute - the user to Read and Execute, and Other to Read, Write, and Execute
0
Comment
Question by:themobileman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 

Expert Comment

by:adud
ID: 8105997
try umask...use the following settings :

0 - read, write, and execute
1 - read & write
2 - read & execute
3 read only
4- write and execute
5- write only
6 - execute only
7 - no permissions granted.

h
..
0
 

Expert Comment

by:adud
ID: 8106001
try umask...use the following settings :

0 - read, write, and execute
1 - read & write
2 - read & execute
3 read only
4- write and execute
5- write only
6 - execute only
7 - no permissions granted.

h
..
0
 
LVL 1

Accepted Solution

by:
Jaem earned 100 total points
ID: 8114582
chown is for changing ownership:
chown -R username.groupname dirname
will change recursively (-R) ownership of dirname to user "username" and group "groupname"

chmod is for modifying permissions:
chmod -R u+rwX,g=rX,o+rwX dirname
would change recursively permission for dirname and anything below it to
* owner read write execute (u+rwX)
* group read execute (g=rX)
* other read write execute (o+rwX)

Note that you have to use X instead of x, so that non-executable files do not get the x perm set.
0
WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

 
LVL 1

Author Comment

by:themobileman
ID: 8132941
What about changing the permissions on files within that directory, not just the parent and subdirectories?
0
 
LVL 1

Author Comment

by:themobileman
ID: 8141328
Even though it didn't change the permissions of all the files in the directories, it changed the permissions of the directories and subdirectories.
0
 
LVL 1

Expert Comment

by:Jaem
ID: 8152101
To change the perms of all files in a directory, I would cd into it and do "chmod u+rwX,g=rX,o=rX *". Note that also would affect directories. Hence you would have then to check/modify the perms of the directories. Also in my example, the perms group don't write but others is weird, since other perms are supposed to be more restrictive than group perms.
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month11 days, 1 hour left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question