Home > Article > Operation and Maintenance > How to call CreateKeyPair to create an SSH key pair
This article introduces how to call CreateKeyPair to create a pair of SSH key pairs, and focuses on the specific steps. The content of this article is compact, and I hope you can gain something.
CreateKeyPair
Create an SSH key pair. We store the public portion of the key for you and return the unencrypted PEM-encoded private key in PKCS#8 format. You need to keep your private key properly. For more details, see SSH Key Pairs.
Description
In addition to calling CreateKeyPair to create a key pair, you can also use a third-party tool to create a key pair and then upload it ( ImportKeyPair) to an Alibaba Cloud region, and its usage is consistent with the key pair we created for you.
The maximum number of key pairs you have in each region is 500.
Request parameters
##Return parameters
Example
Request Example
https://ecs.aliyuncs.com/?Action=CreateKeyPair &RegionId=cn-qingdao &KeyPairName=test &<公共请求参数>
Return example
XML format
<CreateKeyPairResponse> <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId> <KeyPairName>test</KeyPairName> <KeyPairFingerPrint>89:f0:ba:62:ac:b8:aa:e1:61:5e:fd:81:69:86:6d:6b:f0:c0:5a:d7</KeyPairFingerPrint> <PrivateKeyBody>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</PrivateKeyBody> </CreateKeyPairResponse>
JSON format
{ "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E" "KeyPairName": "test" "KeyPairFingerPrint": "89:f0:ba:62:ac:b8:aa:e1:61:5e:fd:81:69:86:6d:6b:f0:c0:5a:d7" "PrivateKeyBody": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }
Error code
The following are error codes unique to this interface. For more error codes, please visit the API Error Center.The above is the detailed content of How to call CreateKeyPair to create an SSH key pair. For more information, please follow other related articles on the PHP Chinese website!