LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-26-2008, 12:54 PM   #1
hevfuture
LQ Newbie
 
Registered: Mar 2008
Posts: 3

Rep: Reputation: 0
Forcing User Permissions on a Directory (and all subdirectories and files in the dir)


Hi,

I have a folder called 'main' for which I want to force the user 'joe' and group 'administrators' for all subdirectories and all files created inside it. (This is because I want all files created in the folder 'main' to be accessible by both the employee 'joe' and the 'administrators', regardless of who creates the file)

I have successfully used the SGID (set group ID) sticky bit to force the group 'administrators', but I have not found a way to force the user 'joe' on all files. SUID (set user ID) sticky bit does not work for this, as this is not part of the allowed functionality of SUID for a directory.

I have searched forums and sites for hours with no luck. Any help is appreciated!!

Thanks!
 
Old 03-26-2008, 01:23 PM   #2
Hammett
Senior Member
 
Registered: Aug 2003
Location: Barcelona, Catalunya
Distribution: Gentoo
Posts: 1,042

Rep: Reputation: 54
I guess you already tried, but anyway....
Code:
chown -R joe:administrator main
 
Old 03-26-2008, 01:30 PM   #3
hevfuture
LQ Newbie
 
Registered: Mar 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Hammett View Post
I guess you already tried, but anyway....
Code:
chown -R joe:administrator main
Will the command above simply change the existing permissions as defined above or enforce the above permissions for all files created in the future?

I need a method to enforce the above permissions for all files created in the future.

Thanks!
 
Old 03-26-2008, 01:39 PM   #4
Hammett
Senior Member
 
Registered: Aug 2003
Location: Barcelona, Catalunya
Distribution: Gentoo
Posts: 1,042

Rep: Reputation: 54
AFAIK this command changes the ownage of existing files.

Any other file created here, will be from joe, administrator or any other user depending on the permissions set for user and group and the whole "main" folder (if administrator group does not have write permissions, there won't be any file from administrator group).

Not only you have to change ownage of folder and files, but also specify permissions for user and group for that folder and files.

Hope this helps!
 
  


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
permissions not inheriting to subdirectories/files pridefc Linux - Security 4 12-11-2006 01:21 AM
extract files from subdirectories to another dir hamboy Linux - Newbie 1 09-15-2006 10:00 AM
Forcing user home directory Anthraxnz Linux - Newbie 7 05-10-2006 03:02 AM
copy 3 files to a directory and all subdirectories? snip128 Linux - Newbie 9 08-12-2005 10:18 PM
Copying all files from subdirectories into one directory Hegemon Linux - General 3 01-17-2005 12:25 PM


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