System Administration Guide: Security Services

ProcedureHow to Change File Permissions in Symbolic Mode

  1. If you are not the owner of the file or directory, become superuser or assume an equivalent role.

    Only the current owner or superuser can use the chmod command to change file permissions on a file or directory.

  2. 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 Table 7–5.

    filename

    Specifies the file or directory.

  3. Verify that the permissions of the file have changed.


    % ls -l filename
    

Example 7–3 Changing Permissions in Symbolic Mode

In the following example, read permission is taken away from others.


% chmod o-r example-file1

In the following example, read and execute permissions are added for user, group, and others.


$ chmod a+rx example-file2

In the following example, read, write, and execute permissions are assigned to group.


$ chmod g=rwx example-file3