---
title: "importLoginKey"
slug: "cli-server-importloginkey"
updated: 2026-04-23T08:56:59Z
published: 2026-04-23T08:58:53Z
canonical: "cli.ncloud-docs.com/cli-server-importloginkey"
---

> ## 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.

# importLoginKey

## 개요<a name="개요"></a>

로그인키 import

## 설명 <a name="설명"></a>

서버인스턴스(VM)를 생성하고, 생성된 서버인스턴스(VM)에 접속 시 로그인키를 이용하여 비밀번호를 암호화 하고 복호화 하는 키를 생성합니다. 사용자가 직접 ssh-keygen 으로 생성한 public key 를 import 합니다. 

## 요청 파라미터 <a name="요청파라미터"></a>

| 파라미터명   | 필수 여부 | 타입     | 제약사항      | 설명     |
| ------------ | --------- | -------- | ------------- | -------- |
| keyName      | Yes       | String   | Min:3, Max:30 | - 생성할 키 명<br>이미 생성된 키명이 존재할 경우 오류 발생 |
| publicKey    | Yes       | String   |               | - import 할 공개키<br> ssh-keygen -t rsa -C "my-key" -f ~/.ssh/my-key 로 생성한 public 키<br> ex) ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCfE6pQTOpsdQNsFtZpIzqDMyb8gH2XUUGe+9s8b36OO0i1<br> ex) file://directory1/directory2/test.pub <br> ex) https://kr.objectstorage.ncloud.com/bucket/test.pub |                                                                                                                                               

## 응답 데이터 타입 <a name="응답데이터타입"></a>

- LoginKeyList 타입

| LoginKeyList extends CommonResponse |
| ----------------------------------- |
| private String fingerprint;         |
| private String keyName;             |
| private String createDate;          |


## 예시 <a name="예시"></a>

### 호출 <a name="호출"></a>

```
ncloud server importLoginKey --keyName ncloudTest --publicKey "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCfE6pQTOpsdQNsFtZpIzqDMyb8gH2XUUGe+9s8b36OO0i1SXkO8+u3/4EXYdujjIH+EKb9LzMiAXOtEUX0hI+zAlJemE+sBKPTORBb+YjLvBYb99ts3pdd7x1S/dgksyxdC6ru8KNS7heU0fARZGhCXmzI9Z6PhSqFMNQcUq14UYLNHUJYshuqHv/sjCBt3QgpMLcaBmgl6TLfdq7ZW0G/iz6V1a2q200A+Fq8Yuc0JLz6Q/xQqWi1+ehKs5y3Ow3D08NLwj8Ay/7eIXqk40oo+GqkQSVWIFV3lzJXB4Po10ZRC67RdCnyf8fYbZYzYP6trr/hItvmXDryEKFUnJgZ"
ncloud server importLoginKey --keyName ncloudTest --publicKey file://directory1/directory2/test.pub
ncloud server importLoginKey --keyName ncloudTest --publicKey https://kr.objectstorage.ncloud.com/bucket/test.pub
```

### 응답 <a name="응답"></a>
 
```json
{
  "importLoginKeyResponse": {
    "requestId": "7f7c33d6-ce42-40c0-81a8-7df102c71d41",
    "returnCode": "0",
    "returnMessage": "success",
    "totalRows": 1,
    "loginKeyList": [
      {
        "fingerprint": "-",
        "keyName": "ncloud-import-key1",
        "createDate": "2018-06-26T17:54:47+0900"
      }
    ]
  }
}
```
```xml
<?xml version="1.0" encoding="UTF-8" ?>
<importLoginKeyResponse>
    <requestId>7f7c33d6-ce42-40c0-81a8-7df102c71d41</requestId>
    <returnCode>0</returnCode>
    <returnMessage>success</returnMessage>
    <totalRows>1</totalRows>
    <loginKeyList>
        <fingerprint>-</fingerprint>
        <keyName>ncloud-import-key1</keyName>
        <createDate>2018-06-26T17:54:47+0900</createDate>
    </loginKeyList>
</importLoginKeyResponse>
```
