Go to main content

Securing Files and Verifying File Integrity in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020

How to Change Group Ownership of a File

Before You Begin

If you are not the owner of the file or directory, you must be assigned the Object Access Management rights. 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.

  1. Change the group ownership of a file.
    % chgrp scifi example-file

    For information about setting up groups, see Chapter 1, About User Accounts and User Environments in Managing User Accounts and User Environments in Oracle Solaris 11.4.

  2. Verify that the group ownership of the file has changed.
    % ls -l example-file
    -rw-r--r--   1 stacey   scifi   112640 June 20 08:55  example-file

    Also see Example 2, Enabling Users to Change the Ownership of Their Own Files.