Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page
Help Center/ SoftWare Repository for Container/ User Guide/ Image Management/ Obtaining a Long-Term Valid Login Command

Obtaining a Long-Term Valid Login Command

Updated on 2024-06-19 GMT+08:00

Scenario

This section describes how to obtain a login command that is permanently valid.

NOTE:
  • For security purposes, it is advised to obtain the login command in the development environment.

Process

You can obtain a long-term valid login command as the following process:

Figure 1 Process

Procedure

  1. Obtain the programmatic access permission. (If the current user has the permission, skip this step.)

    1. Log in to the management console as an administrator.
    2. Click in the upper left corner and select a region and a project.
    3. Click in the navigation pane on the left and choose Management & Governance > Identity and Access Management.
    4. Enter the name of the user to whom you want to grant the programmatic access permission in the search box on the Users page.
      Figure 2 User list
    5. Click the user to go to its details page.
    6. Click next to Access Type.
      Figure 3 Changing access type
    7. Select Programmatic access. (You can select only programmatic access or both access types.)
      Figure 4 Changing the access type

  2. Obtain the regional project name and image repository address.

    1. Log in to the IAM console.
    2. Hover the cursor over the username in the upper right corner.
    3. Choose My Credentials from the drop-down list.
    4. In the project list, find the region and project to which your VM belongs.
      Figure 5 Region and project

  3. Obtain an AK/SK.

    NOTE:

    The access key ID (AK) and secret access key (SK) are a pair of access keys used together to authenticate users who wish to make API requests. The AK/SK pair provides functions similar to a password. If you already have an AK/SK, skip this step.

    1. Log in to the IAM console, hover over your username, and click My Credentials.
    2. In the navigation pane on the left, choose Access Keys and click Create Access Key.
    3. Enter a description, and click OK.
    4. In the displayed dialog box, click Download.

      After the certificate is downloaded, obtain the AK and SK information from the credentials file.

      Table 1 credentials file

      User Name

      Access Key Id

      Secret Access Key

      a*****

      RVHVMX******

      H3nPwzgZ******

      NOTE:

      Keep the AK/SK file confidential to prevent information leakage.

  4. Log in to a Linux PC and run the following command to obtain the login key:

    printf "AK" | openssl dgst -binary -sha256 -hmac "SK" | od -An -vtx1 | sed 's/[ \n]//g' | sed 'N;s/\n//'

    Replace AK with the Access Key Id and SK with Secret Access Key in the credentials file in Step 3.

    Examples:

    printf "RVHVMX******" | openssl dgst -binary -sha256 -hmac "H3nPwzgZ******" | od -An -vtx1 | sed 's/[ \n]//g' | sed 'N;s/\n//'

    After the command is executed, the following login key is obtained:

    cab4ceab4a1545***************
    NOTE:

    The preceding key is only an example.

  5. Use the information you obtained to generate a long-term valid login command in the following format:

    docker login -u [Regional project name]@[AK] -p [Login key] [Image repository address]

    In the command, the regional project name and image repository address are obtained in 2, the AK in 3, and the login key in 4.

    Examples:

    docker login -u ap-southeast-3@RVHVMX****** -p cab4ceab4a1545*************** swr.ap-southeast-3.myhuaweicloud.com

    If the Login Succeeded message is displayed, it indicates that the login is successful.

    NOTE:
    • The login key is encrypted and cannot be decrypted. Therefore, other users cannot obtain the SK from -p.
    • The login command can be used on other devices.

  6. (Optional) When you log out the repository, run the following commands to delete your authentication information.

    cd /root/.docker/
    rm -f config.json

  7. Run the history -c command to clear the operation records.

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback