هذه الصفحة غير متوفرة حاليًا بلغتك المحلية. نحن نعمل جاهدين على إضافة المزيد من اللغات. شاكرين تفهمك ودعمك المستمر لنا.

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
Situation Awareness
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

Logging In to a Linux ECS Using an SSH Key Pair

Updated on 2024-07-24 GMT+08:00

Scenarios

This section describes how to use an SSH key pair to remotely log in to a Linux ECS from a Windows and a Linux server, respectively.

Prerequisites

  • You have configured the inbound rules of the security group. For details, see Configuring Security Group Rules.
  • The network connection between the login tool (PuTTY) and the target ECS is normal. For example, the default port 22 is not blocked by the firewall.

Logging In to a Linux ECS from a Local Windows Server

You have two methods to log in to a Linux ECS from a local Windows server.

Method 1: Use PuTTY to log in to the ECS.

The following operations use PuTTY as an example. Before using PuTTY to log in, make sure that the private key file has been converted to .ppk format.
  1. Check whether the private key file has been converted to .ppk format.
    • If yes, go to step 7.
    • If no, go to step 2.
  2. Visit the following website and download PuTTY and PuTTYgen:

    https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

    NOTE:

    PuTTYgen is a key generator, which is used to create a key pair that consists of a public key and a private key for PuTTY.

  3. Run PuTTYgen.
  4. In the Actions pane, click Load and import the private key file that you stored during ECS creation.

    Ensure that the format of All files (*.*) is selected.

    Figure 1 Importing the private key file
  5. In the Actions area, click Save private key.
  6. Save the converted private key, for example, kp-123.ppk, to the local computer.
  7. Double-click PUTTY.EXE. The PuTTY Configuration page is displayed.
  8. Choose Session and enter the EIP of the ECS under Host Name (or IP address).
    Figure 2 Configuring the EIP
  9. Choose Connection > Data. Enter the image username in Auto-login username.
    Figure 3 Entering the username
    NOTE:

    When you log in to an ECS using an SSH key:

    • The image username is core for a CoreOS public image.
    • The image username is root for a non-CoreOS public image.
  10. Choose Connection > SSH > Auth > Credentials. In the configuration item Private key file for authentication, click Browse and select the private key converted in step 6.
    Figure 4 Importing the private key file
  11. Click Open to log in to the ECS.

Method 2: Use Xshell to log in to the ECS.

  1. Start the Xshell tool.
  2. Run the following command using the EIP to remotely log in to the ECS through SSH:

    ssh Username@EIP

    NOTE:

    When you log in to an ECS using an SSH key:

    • The image username is core for a CoreOS public image.
    • The image username is root for a non-CoreOS public image.
  3. (Optional) If the system displays the SSH Security Warning dialog box, click Accept & Save.
    Figure 5 SSH Security Warning
  4. Select Public Key and click Browse beside the user key text box.
  5. In the user key dialog box, click Import.
  6. Select the locally stored key file and click Open.
  7. Click OK to log in to the ECS.

Logging In to a Linux ECS from a Local Linux Server

To log in to the Linux ECS from local Linux, perform the operations described in this section. The following operations use private key file kp-123.pem as an example to log in to the ECS. The name of your private key file may differ.
  1. On the Linux CLI, run the following command to change operation permissions:

    chmod 400 /path/kp-123.pem

    NOTE:

    In the preceding command, replace path with the actual path where the key file is saved.

  2. Run the following command to log in to the ECS:

    ssh -i /path/kp-123.pem Default username@EIP

    For example, if the default username is root and the EIP is 123.123.123.123, run the following command:

    ssh -i /path/kp-123.pem root@123.123.123.123

    NOTE:

    In the preceding command:

    • path refers to the path under which the key file is stored.
    • EIP is the EIP bound to the ECS.

Follow-up Procedure

  • After logging in to the ECS using the SSH key, you can set a password (by using the passwd command) to log in to the ECS using VNC.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback