LinuxQuestions.org
Visit Jeremy's Blog.
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 03-08-2010, 04:27 AM   #1
genogp
LQ Newbie
 
Registered: Feb 2009
Posts: 8

Rep: Reputation: 0
Files to inherit user and group


Hi

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?

thanks
 
Old 03-08-2010, 04:38 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Jessie (Fluxbox WM)
Posts: 1,387
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.
 
  


Reply


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 09:06 PM
How can I ensure that files created inherit both user and group of directory vfclists Linux - Software 1 11-21-2009 08:37 PM
setfacl - how to set files to be saved as a particular user:group? neocontrol Linux - Security 2 03-12-2008 09:39 PM
preserve user/group when copying files km4hr Linux - Software 1 01-11-2005 06:21 PM
List files owned by user/group guideweb Linux - General 1 09-18-2004 09:18 PM


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