This documentation is for a release that is no longer maintained.
You can select a different version or view all RHACS documentation.1.2. 使用 roxctl CLI 进行身份验证
要进行身份验证,您可以使用身份验证令牌或管理员密码。红帽建议在生产环境中使用身份验证令牌,因为每个令牌被分配了特定的访问控制权限。
使用以下步骤生成身份验证令牌。
流程
- 进入 RHACS 门户。
-
进入 Platform Configuration
Integrations。 - 向下滚动到 Authentication Tokens 类别,然后单击 API Token。
- 点 Generate Token。
- 为令牌输入一个名称,再选择提供所需访问级别的角色(例如,持续集成或 Sensor Creator )。
点 Generate。
重要复制生成的令牌,并安全地存储它。您将无法再次查看它。
注意
生成身份验证令牌后,将其导出为 ROX_API_TOKEN 变量:
export ROX_API_TOKEN=<api_token>
$ export ROX_API_TOKEN=<api_token>
您还可以将令牌保存到文件中,并将它与 --token-file 选项一起使用。例如:
roxctl central debug dump --token-file <token_file>
$ roxctl central debug dump --token-file <token_file>
-
您不能同时使用
-password(-p)和--token-file选项。 -
如果您已设置了
ROX_API_TOKEN变量,并指定--token-file选项,roxctlCLI 使用指定的令牌文件进行身份验证。 -
如果您已设置了
ROX_API_TOKEN变量,并指定--password选项,roxctlCLI 使用指定的密码进行身份验证。