37
29
I have a folder in which new subfolders and files will be created automatically, by a script.
I want to maintain the user and group permissions recursively for all new folders and files placed in the parent directory. I know this involves setting a sticky bit, but I can't seem to find a command that shows exactly what I need.
This is what I have done so far:
sudo mkdir -p /path/to/parent
sudo chmod -R 660 myself:somegroup /path/to/parent
Thereafter, I want the 660 permissions to be set recursively to any folders and files placed in /path/to/parent
.
However, everything I have tried so far has failed. Can someone help please?
Actually the octal flag 660 is probably not even correct. The permissions I want are:
- Directories placed under
/path/to/parent
are eXecutable by users with permissions - files are read/writeable by user myself and members of somegroup
- Files and folders in
/path/to/parent
is NOT world readable
I am running on Ubuntu 10.0.4 LTS.
Can someone help please?
The simplest solution I think, is to add myself to the apache user group. Thanks for suggesting that. I don't know why I didn't think of that myself! – oompahloompah – 2011-03-31T06:28:51.547
2Is
o+w
a good choice here? Shouldn't the changes be limited tou
andg
? Otherwise, what's the point of trying to maintain security on the directory and sub-directories? – jww – 2014-04-03T07:08:49.540