[CentOS] directory permissions

Tue Jan 12 22:10:19 UTC 2010
Carlos Santana <neubyr at gmail.com>

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.
>
>> 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
>