Solved

Keep OWNER of a new file/directory

Posted on 2011-09-19
2
556 Views
Last Modified: 2012-06-21
Hey Guys!

I need to keep ownership of new files or directories created by any user.

Example:
I have:
drwxr-xr-x 2 apache apache 1 Sep 19 11:17 /var/www/htdocs/website/

So, I need that when any user creates a new file or directory that inherit owner and group.

The group I resolved by setting sgid, so the group is inherit but the OWNER I dont know.

I do not like to create a shellscript and run it every 5 minutes thru crontad. It's a poor solution...

Some hint?
0
Comment
Question by:tbsoares
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 21

Expert Comment

by:Papertrip
ID: 36560769
using chown in a script is the only way to accomplish this in Linux.  setuid is ignored on directories.
0
 
LVL 38

Accepted Solution

by:
wesly_chen earned 500 total points
ID: 36570707
You can change the group permission to "writeable" then "apache" daemon can manipulate the files without be the owner of that files.

Just make sure all the user have
umask 002
  in there ~/.bashrc, ~/.profile or ~/.cshrc  file
   So all the the created files are group writeable.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question