How to Change the Owner of a File
If you are not the owner of the file or directory, you must be assigned the Object Access Management rights profile. To change a file that is a public object, you must assume the root
role.
For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.4.
Example 1-2 Enabling Users to Change the Ownership of Their Own Files
Security Consideration – You need a good reason to change the setting of the rstchown
variable to zero. The default setting prevents users from listing their files as belonging to others so as to bypass space quotas.
In this example, the value of the rstchown
variable is set to zero in the /etc/system
file. This setting enables the owner of a file to use the chown
command to change the file's ownership to another user. This setting also enables the owner to use the chgrp
command to set the group ownership of a file to a group that the owner does not belong to. The change goes into effect when the system is rebooted.
set rstchown = 0
For more information, see the chown
(1) and chgrp
(1) man pages.