[CentOS] directory permissions

Rob Kampen rkampen at kampensonline.com
Tue Jan 12 22:27:06 UTC 2010


Carlos Santana wrote:
> Thanks nate and Paul..
>
> Do I need to use -R recursive option for any of the commands you mentioned?
>
> -
> CS.
>
>
> On Tue, Jan 12, 2010 at 3:58 PM, Paul Heinlein <heinlein at madboa.com> wrote:
>   
>> On Tue, 12 Jan 2010, Carlos Santana wrote:
>>
>>     
>>> Hi,
>>>
>>> I have changed directory ownership permissions recursively such that
>>> it is owned by username:groupname , where groupname is not the
>>> default group, i.e., username. However, when a user creates a new
>>> file the default permissions are again username:username.
>>>
>>> How can I give ownership permissions on a particular directory so
>>> that any files created in that directory will always have specifc
>>> username:groupname permissions?
>>>       
>> chmod 2775 /your/directory
>>
>> This will assign group ownership of any files created in
>> /your/directory to the group that owns that directory.
>>
>> It won't, however, change user ownership. Allowing that sort of
>> operation would be a great avenue for a denial-of-service attach on
>> any filesystem with quotas.
>>
>>     
If you need to sort out sub-directories try - where tld is top level 
directory
$ find tld -type d -print0 | xargs -0 chmod 2775
if you need to clean up files (ie not directory)
$ find tld -type f -print0 | xargs -0 chmod 664
I find that openoffice chokes on files with the sticky bit set - it will 
not save!
>>> Also is there any option that would allow only owner to delete
>>> files, even though group has rwx permissions?
>>>       
>> chmod 3775 /your/directory
>>
>> This combines the 2775 trick mentioned above with an o+s operation.
>> Setting the "sticky bit" on the all-users permissions allows only
>> owners to dispose of files. See the permissions on /tmp or /var/tmp
>> for an example.
>>
>> --
>> Paul Heinlein <> heinlein at madboa.com <> http://www.madboa.com/
>> _______________________________________________
>> CentOS mailing list
>> CentOS at centos.org
>> http://lists.centos.org/mailman/listinfo/centos
>>
>>     
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rkampen.vcf
Type: text/x-vcard
Size: 121 bytes
Desc: not available
Url : http://lists.centos.org/pipermail/centos/attachments/20100112/12ddd2b6/attachment.vcf 


More information about the CentOS mailing list