How to call CreateKeyPair to create a SSH key pair
This article shows you how to call CreateKeyPair to create a pair of SSH keys, the content is detailed and comprehensive, friends in need can refer to it.
CreateKeyPair
Create a SSH key pair. We will keep the public key portion of the key for you and return an unencrypted PEM-encoded PKCS#8 private key. You need to take good care of the private key yourself. For more details, see SSH key pairs.
Description
In addition to calling CreateKeyPair to create a key pair, you can also use third-party tools to create a key pair, and then upload (ImportKeyPair) to a certain Ali Cloud region, which is used in the same way as the key pair we created for you.
Your maximum number of key pairs in each region is 500 pairs.
Request parameter
Return parameters
Example
Request example
Https://ecs.aliyuncs.com/?Action=CreateKeyPair&RegionId=cn-qingdao&KeyPairName=test&
Return the example
XML format
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E test 89:f0:ba:62:ac:b8:aa:e1:61:5e:fd:81:69:86:6d:6b:f0:c0:5a:d7 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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 the error codes specific to this API. For more error codes, please visit the API error Center.
This is the method of using CreateKeyPair to create a SSH key pair. Have you learned anything after reading it? If you want to know more about it, welcome to the industry information!