ckauth Command

Purpose

Checks the current user session for an authorization.

Syntax

ckauth [-A] { AuthName [,AuthName] ... }

Description

The ckauth command determines whether the process that the ckauth command is invoked in has the authorizations specified by the AuthName parameter. The command is used in shell scripts that need to check for authorizations. With the ckauth command, you can specify a single authorization or multiple authorizations through a comma-separated list. The ckauth command returns 0 when the calling process has any of the listed authorizations. If you specify the -A option, the ckauth command returns 0 when the calling process has all of the listed authorizations. A nonzero value is returned for failures.

Flags

Item Description
-A Checks whether the calling process has all of the listed authorizations.

Examples

  1. To determine whether the existing user session has the aix.fs.manage authorization, use the following command:
    $ ckauth aix.fs.manage
    $ echo $?
    0
  2. To determine whether the existing user session has both the aix.security.user and aix.security.group authorizations, use the following command:
    $ ckauth -A aix.security.user,aix.security.group
    $ echo $?
    0