Documentation Index

Fetch the complete documentation index at: https://cli.ncloud-docs.com/llms.txt

Use this file to discover all available pages before exploring further.

createLoginKey

Prev Next

Available in VPC

Create an authentication key (login key) to use when connecting to the server instance (VM) via SSH. Since the private key value is issued only once in the response and cannot be retrieved later, store it securely in a separate location.

Syntax

The createLoginKey syntax is as follows:

./ncloud vserver createLoginKey \
    [--keyName <key-name>] \
    [--regionCode <KR|SGN|JPN>] \
    [--output <json|xml>]

Options

This section describes the options available when running createLoginKey.

Optional options

These are the optional options for createLoginKey. Options that are not specified will use their default values.

Options Type Required Description
--keyName String Optional Authentication key name
  • Automatically generated if not entered.
  • Enter 3-30 characters using a combination of lowercase English letters, numbers, and special character -.
  • The string must start with a lowercase English letter and end with a lowercase English letter or a number.

Common options

For information about the options common to all vserver subcommands, see Server (VPC) options.

Examples

If the authentication key generation request is successful, the authentication key name and private key are returned.

Command

The command example is as follows:

./ncloud vserver createLoginKey \
    --keyName test-login-key-01 \
    --regionCode KR \
    --output json

Output

The output example is as follows:

{
  "createLoginKeyResponse": {
    "keyName": "test-login-key-01",
    "privateKey": "-----BEGIN RSA PRIVATE KEY-----\n<private-key-redacted>\n-----END RSA PRIVATE KEY-----\n",
    "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "returnCode": "0",
    "returnMessage": "success"
  }
}