LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 04-09-2011, 10:09 AM   #1
rbalaa
Member
 
Registered: Mar 2010
Posts: 61

Rep: Reputation: 0
Permissions when creating files&folders


Hello,

I'm having a tough time with permissions. I want to make a folder and ALL its subfolders automatically have set permissions and ownerships on any file or folder created by any valid user.

example: 0770 root.staff test.txt

Please help. Thank you.

OS: CentOS 5
 
Old 04-09-2011, 03:08 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Look at file /etc/permissions. In it, you will see the default ownership and permissions for the system. Add an entry for the top level directory, with ownership and permissions you desire.

For example: let's say you have a data partition mounted at /mnt/data. You want root ownership, but staff group members should also be able to enter and write (create folders and files) in the data partition. Make an entry in /etc/permissions like this:
/mnt/data root:staff 777

Try it to see if it solves your problem.
 
Old 04-09-2011, 03:58 PM   #3
rbalaa
Member
 
Registered: Mar 2010
Posts: 61

Original Poster
Rep: Reputation: 0
I couldn't find a file "/etc/permissions", also I made a mistake in my post, this is actually Ubuntu (Debian). Does a 'permission' file exist on there.

Thanks for your reply and help.
 
Old 04-09-2011, 05:50 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I'm pretty sure you cannot cause the ownership of a file to be automatically set to some user other than the creator. Probably the same for group ownership. You can set the umask of each user to cause files to be created with a certain permission mask. You can make all of the users exist in the same default group, so that everyone gets the same group ownership and group permission.

--- rod.
 
  


Reply



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
Help with permissions on new files/folders StupidNewbie Linux - Server 2 04-27-2010 10:58 AM
Permissions on folders & Partitions Ubuntu ahmed_as8 Linux - Newbie 7 01-31-2009 06:21 AM
permissions of files and folders binary_dreamer Linux - General 2 04-05-2006 11:13 PM
Fedora: Error creating folders or writing to files thecrozz Linux - Software 1 02-02-2006 07:12 AM
files&folders permissions under SAMBA share shani Linux - Software 2 11-20-2003 11:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:51 PM.

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