Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-08-2010, 03:27 AM   #1
LQ Newbie
Registered: Feb 2009
Posts: 8

Rep: Reputation: 0
Files to inherit user and group


Ok i have a directory ( /dir1) that belongs to a user1:group1. I need to know if this is possible and if so a basic idea of how to.

when i copy a file into /dir1 (as root) i would like it to obtain a different user and group. Is this possible?

Old 03-08-2010, 03:38 AM   #2
Senior Member
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Stretch (Fluxbox WM)
Posts: 1,389
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
You can use the setgid bit of a directory so that a file placed in that directory will inherit the group id (it doesn't affect the user id though). The directory /usr/local is often managed this way.


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
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
setfacl - how to set files to be saved as a particular user:group? neocontrol Linux - Security 2 03-12-2008 08:39 PM
preserve user/group when copying files km4hr Linux - Software 1 01-11-2005 05:21 PM
List files owned by user/group guideweb Linux - General 1 09-18-2004 08:18 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration