LinuxCommandLibrary

odpscmd-auth

TLDR

[Interactive] Add a user to the current project

$ add user [username];
copy

[Interactive] Grant a set of authorities to a user
$ grant [action_list] on [object_type] [object_name] to user [username];
copy

[Interactive] Show authorities of a user
$ show grants for [username];
copy

[Interactive] Create a user role
$ create role [role_name];
copy

[Interactive] Grant a set of authorities to a role
$ grant [action_list] on [object_type] [object_name] to role [role_name];
copy

[Interactive] Describe authorities of a role
$ desc role [role_name];
copy

[Interactive] Grant a role to a user
$ grant [role_name] to [username];
copy

SYNOPSIS

odpscmd-auth [-p project] [-e endpoint] [-i accessKeyId] [-k accessKeySecret] [--interactive] [--mode ak|sts]

PARAMETERS

-p, --project
    MaxCompute project name

-e, --endpoint
    Service endpoint URL (e.g., https://service.odps.aliyun.com/api)

-i, --accessKeyId
    Alibaba Cloud AccessKey ID

-k, --accessKeySecret
    Alibaba Cloud AccessKey Secret

--stsToken
    Temporary STS security token

--mode
    Authentication mode

--interactive
    Interactive login prompt

-h, --help
    Display help

DESCRIPTION

The odpscmd-auth command authenticates users to Alibaba Cloud's MaxCompute (formerly ODPS) service via the command-line console client. It configures access credentials, project settings, and endpoints for secure interaction with big data processing tasks.

Typically invoked before using odpscmd for SQL execution, data management, or tunnel uploads/downloads. Supports AccessKey, STS tokens, and RAM roles. Stores config in ~/.odpsconf for persistent sessions. Essential for developers and data engineers working with petabyte-scale data analytics on MaxCompute.

CAVEATS

Requires valid Alibaba Cloud credentials; config overwrites ~/.odpsconf; network access to endpoints mandatory. Not for public clusters without VPC.

CONFIGURATION FILE

Edits ~/.odpsconf or ~/.ini with sections like [common], [tasks]. Example:
endpoint=https://service.odps.aliyun.com/api
accessKeyId=yourID
accessKeySecret=yourSecret

USAGE EXAMPLE

odpscmd-auth -p myproject -e https://service.odps.aliyun.com/api -i ID -k SECRET
Followed by odpscmd for queries.

HISTORY

Introduced in MaxCompute client v2.0 (2015); enhanced STS support in v3.1 (2019). Developed by Alibaba Cloud for ODPS/MaxCompute CLI ecosystem.

SEE ALSO

odpscmd(1), console.sh(1), odpsconf(5)

Copied to clipboard