Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Setting up recursive permissions on shared folders Network
I was reading about some of the problems with 10.2.2 and the 'security' of having all copied files set to read only permissions for files copied over to another machine. I found a bit about setting permissions on a directory so that they would hold its parents permissions when copied into the directory.

I created a folder called 'shares' and created folders within that for each of the designers on my team to dump files that we need to go back and forth with. In SharePoints, I made the 'shares' a sharepoint, and then added a group with all of the designers. I set the permissions for the folders to myself as the owner and the group is the one created above. This allowed me to delete files within the subdirectories when I didn't need them any longer.

Then in the terminal, I cd'd over to the directory and did a "ls -l" and got:
 drwxrwx--x
as the listing for the folder ... all seemed well. I then ran:
 % chown g+s 'dirname'
At least all of the files that are dragged into it take on the permissions from the directory above, but folders that are created inside by a shared user don't. Any files that are put in by the shared user into a folder they create I need to run thru batchmod and reset, then I can delete it. But files that are dragged into the main directory can be deleted no problem.

I am sure there is lots more that can be worked with this, I have just been trying to find a way to be able to share files a lot easier. We don't use the 'public' folders since they are on the boot drives and we set the systems up for better access with all of the graphic and video files that we use.

[Editor's note: I have not tested this myself...]
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[9,955 views]  

Setting up recursive permissions on shared folders | 4 comments | Create New Account
Click here to return to the 'Setting up recursive permissions on shared folders' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
why not use -R?
Authored by: veloso on Nov 20, '02 11:28:34AM

chown -R g+s 'dirname' will recursively set permissions.
Works on chmod too!



[ Reply to This | # ]
why not use -R?
Authored by: whoadoggy on Nov 20, '02 03:03:35PM

Wouldn't it then make sense to "cron" this command so that the whole folder is kept accesible to all. That how I always wanted the "shared" folder to work.



[ Reply to This | # ]
Be careful with this
Authored by: gxw on Nov 20, '02 07:50:22PM

The use of +s in chmod can open up some real nasty security holes!!
I have seen a lot of security bulletins come out for Linux due to the use of the "s" bits. If you have executable files tagged with the +s they will run under the permissions of that owner or group (u+s or g+s).
Example:
An executable file that is owned by root and world executable (o+x) will run with root's permissions if the +s attribute is applied to the owner's permissions.

In the case of this hint, if the group membership is set to wheel, and you apply a g+s to an execcutable file, this file will assume wheel's permissions when it is run.

It would probably be better to do something with a umask (don't know where to get more info about umask) or to use chmod & chown with the -R switches (recursive) so you can avoid the +s stuff.



[ Reply to This | # ]
Be careful with this
Authored by: bluehz on Nov 22, '02 09:34:20AM

I am not real up to date on this - but I thought there was a method to give permissions to dir so that anything dropped into the dir assumes those permissions. Is this not correct?

In my case - I have a web dir I drop files into all the time for download but I have to go in and manually give the files web ownership before they are downloadable. Isn't there a method that autosets the permissions?



[ Reply to This | # ]