Managing Users

User names are unique within a specific tenant, and tenant names are unique within the system as a whole.

add user

This command enables you to add new users.

Note:

Only a tenant administrator can add a new user.

Syntax

oracle-compute add user username fullname email [ --role] [ --password]

Parameters and Options

The following parameters are specific to this command. You can also use the common options described in General Command Options.

Parameter Description
username An unique hierarchical name for a user. For example, /mytenant/myuser.

Object names can contain only alphanumeric characters, hyphens, and periods. Object names are case-sensitive.

fullname Full name of the user
email Valid email address
--role (Optional) The role of a user in the system.

This option can be specified only by the Oracle Cloud Administrator. A user can be granted one of the following roles:

  • /cloud/admin for Oracle Cloud Administrators

  • /cloud/monitor for cloud monitors

  • /tenant_name/admin for tenant administrators

  • /tenant_name/users for tenant users

If this option is not specified, then the default role of /tenant_name/users is granted.

--password (Optional) User password. The password should be specified in a regular file, or should be entered from the terminal.

You can supply the password in one of the following ways:

  • Specify the full path and name of the file containing the password .

    Note that it must be a text file that is not world-readable (permission level: 600).

  • Use a hyphen (-), to denote that you want to be prompted for the password value and enter it directly into the terminal.

If you omit this option, you will be prompted to enter and confirm the password. The password is stored in an encrypted format.

The password for a user must meet the following requirements:
  • Alphanumeric.

  • At least 6 characters in length.

  • At least 5 unique characters. For example, "azylaz" is not a valid password but "azylmz" is valid. 

  • Can contain underscore and dash.

  • Must not contain a sequence of characters. For example, "abcde1" and "asdfgh" are not valid passwords. 

  • Must not contain a dictionary word.

Example

$ oracle-compute add user /mytenant/myuser “User name” name@example.com --password /root/myuser_pwd.txt

delete user

This command enables you to delete an existing user.

Note:

Only the tenant administrator can delete a user.

Syntax

oracle-compute delete user username

Parameters and Options

The following parameters are specific to this command. You can also use the common options described in General Command Options.

Parameter Description
username Hierarchical name of the user to be deleted. For example, /mytenant/myuser and /cloud/myuser .

Example

$ oracle-compute delete user /mytenant/myuser

update user

This command enables you to update user information.

Note:

Tenant users can only update their password and email address.

Syntax

oracle-compute update user username [--fullname] [--email] [--role] [--password] [--blacklisted]

Parameters and Options

The following parameters are specific to this command. You can also use the common options described in General Command Options.

Parameter Description
username A unique hierarchical name for a user. For example, /mytenant/myuser and /cloud/myuser.
--fullname (Optional) Full name of the user
--email (Optional) Valid email address
--role (Optional) The role of a user in the system.

This option can be specified only by the Oracle Cloud Administrator. A user can be granted any one of the following roles:

  • /cloud/admin for cloud administrators.

  • /cloud/monitor for cloud monitors.

  • /tenant_name/admin for tenant administrators.

  • /tenant_name/users for tenant users

--password (Optional) User password. The password must be specified in a regular text file or entered from the terminal.
The password for a user must meet the following requirements:
  • Alphanumeric.

  • At least 6 characters in length.

  • At least 5 unique characters. For example, "azylaz" is not a valid password but "azylmz" is valid. 

  • Can contain underscore and dash.

  • Must not contain a sequence of characters. For example, "abcde1" and "asdfgh" are not valid passwords. 

  • Must not contain a dictionary word.

--blacklisted (Optional) Specifies if the user is blacklisted.

Example

$ oracle-compute update user /mytenant/myuser --email new.email@example.com

Sample Output

uri              username         id                                   fullname   email       customer role      blacklisted
https://api/user /mytenant/myuser f36f54ca-e8d2-4e56-9371-0acae392c4f1 myuserfull new.email@e mytenant /mytenant False

authenticate user

This command enables you to specify authentication credentials for a user.

Authentication is generally used for testing the credentials for a user. This command returns an authentication cookie that you can use in future CLI requests. You can export this cookie to the ORACLE_COMPUTE_COOKIE environment variable. When you export the cookie, you no longer have to specify -u or -p options for future CLI requests; instead, the authentication information in the cookie is used.

Syntax

Use either of the following commands to specify the authentication credentials of the user:

oracle-compute auth user username password

oracle-compute authenticate user username password

Parameters and Options

The following parameters are specific to this command. You can also use the common options described in General Command Options.

Parameter Description
username Name of the user
password Password for the user

Note:

The password can either be supplied as a command-line argument (in which case the value must be the name of a text file that is not world-readable, containing the password) or omitted from the command and entered directly from the terminal.

Example

$ oracle-compute auth user /mytenant/administrator pwdfile.txt

Sample Output

The following sample cookie is returned.

export ORACLE_COMPUTE_COOKIE='{"identity": "{\"realm\": \"myExa-Site\", \"value\": \"{\\\"customer\\\": \\\"mytenant\...+Kpdvzg==\"}"}'

Retrieve User Details

You can retrieve the user details using CLI.

discover user

This command enables you to discover a list of users in a specific container.

Note:

You can discover only tenant users in your tenancy.

Syntax

oracle-compute discover user container

Parameters and Options

The following parameters are specific to this command. You can also use the common options described in General Command Options.

Parameter Description
container Hierarchical name-space for users

Example

$ oracle-compute discover user /mytenant

Sample Output

$ oracle-compute discover  user /mytenant
entry
/mytenant/administrator
/mytenant/myuser

get user

This command enables you to retrieve information for a specific user.

Note:

You can retrieve information only for tenant users in your tenancy.

Syntax

oracle-compute get user username

Parameters and Options

The following parameters are specific to this command. You can also use the common options described in General Command Options.

Parameter Description
username Hierarchical name of the user. For example, /mytenant/myuser and /cloud/myuser

Example

$ oracle-compute get user /mytenant/myuser

Sample Output

$ oracle-compute get user /mytenant/myuser -F username,id,fullname,email,blacklisted
uri               username        id             fullname email            blackisted
https://api/.../ /mytenant/myuser b730fb22...e7  MyUser   user@example.com False

list user

This command enables you to list users in a specific container.

Note:

You can list only tenant users in your tenancy.

Syntax

oracle-compute list user container [--role]

Parameters and Options

The following parameters are specific to this command. You can also use the common options described in General Command Options.

Parameter Description
container Hierarchical name-space for the user
--role (Optional) The role of a user in the system.
You can filter the list output based on user role by specifying one of the following:
  • /cloud/admin for cloud administrators

  • /cloud/monitor for cloud monitors

  • /tenant_name/admin for tenant administrators

  • /tenant_name/users for tenant users

Example

$ oracle-compute list user /

Sample Output

$ oracle-compute list user / -F username,role
username           role
/mytenant/myuser1  /mytenant/users
/mytenant/myuser2  /mytenant/users