can't change ownership on files

Rick Stevens rstevens at vitalstream.com
Fri Apr 22 22:39:53 UTC 2005


Waldher, Travis R wrote:
> 
>>-----Original Message-----
>>From: Rick Stevens [mailto:rstevens at vitalstream.com]
>>Sent: Friday, April 22, 2005 1:24 PM
>>To: Getting started with Red Hat Linux
>>Subject: Re: can't change ownership on files
>>
>>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.
> 
> Ok, I wasn't clear.
> 
> I as the owner owner can't change the ownership of my own files:
> 
> [user at host /]$ whoami
> user
> [user at host /]$ cd /tmp
> [user at host /tmp]$ touch test
> [user at host /tmp]$ ls -al test
> -rw-rw-r--    1 user  unixadm         0 Apr 22 15:20 test
> [user at host /tmp]$ chown user2 test
> chown: changing ownership of `test': Operation not permitted
> [user at host /tmp]$ ls -al test
> -rw-rw-r--    1 user  unixadm         0 Apr 22 15:20 test
> [user at host /tmp]$
> 
> I should be able to change the ownership of my own files without being
> root.  Correct?

Actually, in Linux, no.  Changing owners and groups is restricted to
root only.  IRIX and Solaris have work arounds, but not in Linux.  My
mistake.

You could permit it in sudo.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-     There are only 10 kinds of people in the world -- those who    -
-                 understand binary and those who don't              -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list