LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 11-21-2009, 04:14 PM   #1
vfclists
LQ Newbie
 
Registered: Nov 2009
Posts: 1

Rep: Reputation: 0
How can I ensure that files created inherit both user and group of directory


I have created some websites in the /home directories for different
users, and I have added the webmaster account to each user's group, to
allow him to create files there. I have used the sticky bit to ensure
that the files are created with the user's group.

The files created are always owned by the webmaster.

How can I ensure that the files also inherit the owner/user as well?

I have also created a samba share that has links in the webmaster's
directory pointing into the user's directories, but I want to ensure
that the files created are owned by the directory user. If I can get
the above issue to work, will samba conform automatically?

/vfclists

Last edited by vfclists; 11-21-2009 at 04:16 PM. Reason: added tags
 
Old 11-21-2009, 07:37 PM   #2
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Etch/Lenny/Squeeze
Posts: 3,477

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
Quote:
Originally Posted by vfclists View Post
I have created some websites in the /home directories for different
users, and I have added the webmaster account to each user's group, to
allow him to create files there. I have used the sticky bit to ensure
that the files are created with the user's group.
Just for the record, if you mean this bit: rw-rws--- then it is called the SETGID bit, not the sticky bit.


Quote:
Originally Posted by vfclists View Post
The files created are always owned by the webmaster.

How can I ensure that the files also inherit the owner/user as well?
AFAIK you cannot. Files are always created by a user as that user. You can change the group tough by assigning a different primary group to a user of use the SETGID bit as you did. The group thingy assures that all users in a group (even if the user is unique in his own group) can read/write the files.

Quote:
Originally Posted by vfclists View Post
I have also created a samba share that has links in the webmaster's
directory pointing into the user's directories, but I want to ensure
that the files created are owned by the directory user. If I can get
the above issue to work, will samba conform automatically?
/vfclists
Samba doesn't know about SETGID bits. As soon as a file is created the Linux file system ensures the correct use of the SETGID. So you will achieve your goal but not because Samba actively supports it. BTW I have noticed that you have to make files rwxrwx--- in order to modify them in Windows. Despite of the rw- bits set you can read and write but not modify.

You can set both the execute bit and SETGID bit. rws means x+S, rwS means S only.

jlinkels
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
inherit permissions of the parent directory in newly created file abhijit_mohanta Linux - Newbie 1 09-10-2009 06:45 PM
Set group on files as they are created gatsby Linux - Newbie 1 02-25-2008 04:53 PM
Set group ownership on files as they are created gatsby Linux - Newbie 1 02-25-2008 03:31 PM
Can you make any files and folders created within a directory owned by another user?? helptonewbie Linux - Newbie 13 12-14-2007 04:21 PM
When configuring files, how do I ensure they get to the right directory? fortunekiller Slackware 7 06-15-2006 10:58 PM


All times are GMT -5. The time now is 12:32 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration