LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-08-2004, 12:18 PM   #1
antony.booth
LQ Newbie
 
Registered: Oct 2004
Location: UK
Distribution: Fedora
Posts: 23

Rep: Reputation: 15
default group on file creation


Is it possible to set a default group when files are created, regardless of what the default group the user is a member of?

I would like to have users who can create files on a virtual host site and by default, the permissions are set so they are the owner and have rw, the group is set to a group only apaches service account is a member of, which has rw, and other users have no access rights.

It is important the user is not a member of the group because files in other virtual hosts will be accessed by the httpd daemon at group level and the user by ownership. All other users would be denied access and the user creating the file is granting access to himself and apache alone. Effectively having 2 owners, the user and the apache service account.

It would be preferable if this was to happen every time a file is created, whether by FTP, script or any other means

Many thanks.
 
Old 10-13-2004, 03:18 AM   #2
iainr
Member
 
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Rep: Reputation: 30
Yep, you set the SGID (Set Group ID) bit on the directory and all files created in that directory get created with the same group.

chmod g+s <dir>
 
Old 10-21-2004, 05:20 AM   #3
antony.booth
LQ Newbie
 
Registered: Oct 2004
Location: UK
Distribution: Fedora
Posts: 23

Original Poster
Rep: Reputation: 15
Thanks for the info, much appreciated.
 
Old 08-24-2007, 06:36 AM   #4
simopal6
Member
 
Registered: Jun 2006
Location: Italy
Distribution: Slackware 13.1
Posts: 230

Rep: Reputation: 30
I'm sorry, i didn't understand.

When i create i file inside my home directory, it receives group 'disk'. My home dir has group 'users'.. What should i do in order to have files created with group 'users'?

Thanks!
 
  


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
Setting group on file creation/edit deiussum Linux - Security 4 06-17-2005 04:50 PM
Setting group automatically upon file creation (local web development configuration) jht2k Linux - Newbie 1 02-11-2005 06:05 AM
How to set default file creation pembo13 Linux - Security 6 07-02-2004 10:44 PM
RPM Spec file creation: %file section question davidas Linux - Newbie 0 03-16-2004 10:36 PM
group passwords + default chosmer Linux - Security 1 07-01-2002 02:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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