can't change ownership on files

Rick Stevens rstevens at vitalstream.com
Fri Apr 22 20:24:29 UTC 2005


Waldher, Travis R wrote:
> [user at host /tmp]$ chown user2 test
> chown: changing ownership of `test': Operation not permitted
> [user at host /tmp]$
> 
> That about sums it up.  I need non-root users to be able to change
> ownership on files.

You defeat the purpose of permissions if you allow anyone to change
ownership of a file.  That's normally reserved for root or the original
owner of the file, and it's inherent in the "w" part of the permissions.

> I heard there is a system setting that can be changed to make this work,
> but I haven't been able to find it.

I think what you're looking for is the "umask".  You can change the
umask value in the shell to set the default permissions for any file
that's created by that shell.

The umask is exclusive ORed with 777 to set the permissions.  For mortal
users, it's set to "002" by default--meaning that files will be created
with 775 (rwxrwxr-x) permissions (777 XOR 002 = 775).

If you want to permit "others" to change ownership and such, edit the
user's .bashrc or whatever and do "umask 000".  That means that user
will create files with default 777 (rwxrwxrwx) permissions.  Again,
you've eliminated any security on that file, so unless you have a
desparate need, DON'T DO IT.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-                   To err is human, to moo bovine.                  -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list