LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-28-2012, 12:06 PM   #1
vicky007aggrwal
Member
 
Registered: Aug 2012
Posts: 95

Rep: Reputation: Disabled
inherit directory group


how can we inherit the group of parent directory while creating new directories under it.

eg: i have /home/admin directory owned by "techAdmin" group

now how i can impose a condition that ,by default whichever directory users create will inherit the parent directory group "techAdmin"

I believe we need to use sticky bit on group but i am not sure,, can someone please suggest that how we can achieve that

Thanks
 
Old 11-28-2012, 12:14 PM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Use SGID permission mode on parant directory. After doing this, any newly created file or sub-directory will inherit the group of parant directory. To do this:
Code:
chmod g+xs /path/to/dir
Or simply use:
Code:
chmod g+s /path/to/dir
--- INFO. ADDED -----
Sticky bit is different from SGID. But it will additionally help to protect content of directory. After setting it, only root, owner of parant dir. or owner of file/subdir. can alter the file/subdir. To set it:
Code:
chmod a+t /path/to/dir
Note: /path/to/dir is full path of parant dir. on which you will set SGID or sticky bit.

Last edited by shivaa; 11-28-2012 at 12:19 PM. Reason: Info added
 
  


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
[SOLVED] C++ classes - a matter of style? inherit or not inherit? worzel1968 Programming 25 03-21-2011 02:40 PM
Files to inherit user and group genogp Linux - Newbie 1 03-08-2010 03:38 AM
How to inherit group ownership from directory when creating a file wastingtime Linux - Software 3 11-24-2009 08:06 PM
How can I ensure that files created inherit both user and group of directory vfclists Linux - Software 1 11-21-2009 07:37 PM
Samba - Inherit Permissions from Parent Directory bence8810 Linux - Software 6 08-03-2006 06:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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