Go to main content

Securing Files and Verifying File Integrity in Oracle® Solaris 11.3

Exit Print View

Updated: October 2017
 
 

How to Change File Permissions in Symbolic Mode

In the following procedure, a user changes permissions on a file that the user owns.

  1. Change permissions in symbolic mode.
    % chmod who operator permissions filename
    who

    Specifies whose permissions are to be changed.

    operator

    Specifies the operation to be performed.

    permissions

    Specifies what permissions are to be changed. For the list of valid symbols, see Figure 5, Table 5, Setting File Permissions in Symbolic Mode.

    filename

    Specifies the file or directory.

  2. Verify that the permissions of the file have changed.
    % ls -l filename

    Note -  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.
Example 3  Changing Permissions in Symbolic Mode

In the following example, the owner removes read permission others.

% chmod o-r example-file1

the following example, the owner adds read and execute permissions for user, group, and others.

% chmod a+rx example-file2

In the following example, the owner adds read, write, and execute permissions for group members.

% chmod g=rwx example-file3