Available in VPC
Create an authentication key (LoginKey) using a public key that the user created with ssh-keygen. 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/importLoginKey |
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
|
publicKey |
String | Required | Public key
|
responseFormatType |
String | Optional | Format of the response data
|
Request example
The request example is as follows:
curl --location --request GET 'https://ncloud.apigw.ntruss.com/vserver/v2/importLoginKey
?regionCode=KR&keyName=test-***
&publicKey=ssh-rsa%20AAAAB3NzaC1...BrFL%20test-***
&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 |
---|---|---|---|
importLoginKeyResponse |
Object | - | Response result |
importLoginKeyResponse.LoginKeyList |
Array | - | Authentication key list: See LoginKeyList. |
importLoginKeyResponse.requestId |
String | - | ID for the request
|
importLoginKeyResponse.returnCode |
String | - | Response code |
importLoginKeyResponse.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:
{
"importLoginKeyResponse": {
"loginKeyList": [
{
"fingerprint": "",
"keyName": "test-***",
"createDate": "2025-06-25T17:20:42+0900"
}
],
"requestId": "e58e0e57-6a45-4939-92ab-62ad721f70d2",
"returnCode": "0",
"returnMessage": "success"
}
}