createLoginKey

Prev Next

Available in VPC

Create an authentication key (LoginKey) to use when accessing a server instance (VM) via SSH. The authentication key consists of a public key and a private key pair, and the response will return the authentication key name and private key value. The private key value can be used to determine the admin password used to connect to the server. The private key value can't be re-checked after it is initially issued in the response result, so it needs to be stored separately and securely.

Request

This section describes the request format. The method and URI are as follows:

Method URI
GET | POST /vserver/v2/createLoginKey
Note

This guide is based on the GET method. POST method call tests can be performed through Swagger in the API Gateway service of the NAVER Cloud Platform console.

Request headers

For information about the headers common to all Server APIs, see Server request headers.

Request query parameters

You can use the following query parameters with your request:

Field Type Required Description
regionCode String Optional Region code
keyName String Optional Authentication key name
  • Auto-generated on no input (default)
  • Enter 3 to 30 characters using a combination of lowercase English letters, numbers, and the special character "-".
  • The string must start with a lowercase English letter and end with a lowercase English letter or a number.
responseFormatType String Optional Format of the response data
  • xml (default) | json

Request example

The request example is as follows:

curl --location --request GET 'https://ncloud.apigw.ntruss.com/vserver/v2/createLoginKey
?regionCode=KR&keyName=test-***
&responseFormatType=json' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'

Response

This section describes the response format.

Response body

The response body includes the following data:

Field Type Required Description
createLoginKeyResponse Object - Response result
createLoginKeyResponse.keyName String - Authentication key name: See KeyName.
createLoginKeyResponse.privateKey String - Private key: See PrivateKey.
createLoginKeyResponse.requestId String - ID for the request
  • UUID format
createLoginKeyResponse.returnCode String - Response code
createLoginKeyResponse.returnMessage String - Response message

Response status codes

For information about the response status codes common to all Server APIs, see Server response status codes.

Response example

The response example is as follows:

{
    "createLoginKeyResponse": {
        "keyName": "test-***",
        "privateKey": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAzbhX0SkB+N3y...ztJreCiOl7hBaFqezYdQHughrPA==\n-----END RSA PRIVATE KEY-----",
        "requestId": "71d2d438-18eb-400c-a65d-626601edafcc",
        "returnCode": "0",
        "returnMessage": "success"
    }
}