getRootPassword

Prev Next

Can be used in a VPC environment.

Overview

Gets the password of the root account using the login key of server instances (VM).
If privateKey is not entered, the encrypted password of the corresponding server instance will be retrieved.

Request

Request parameter

Parameter name Requirement status Type Restrictions Description
regionCode No String - Region code
Determines the region of the server instance to get the root account password from.
regionCode can be obtained through the getRegionList action.
Default: Selects the first region of the getRegionList search results.
serverInstanceNo Yes String - Server instance number
serverInstanceNo can be obtained through the getServerInstanceList action.
privateKey No String - Login key assigned to the server instance
Enter the personal key (.pem) path or text of the created or imported login key
Example 1: --privateKey "file://PATH/KEY_NAME.pem" (the path starting with string "file://")
Example 2: --privateKey "https://URL/KEY_NAME.pem" (the path starting with string "http://" or "https://")
ex3) --privateKey \
"-----BEGIN RSA PRIVATE KEY-----\
...KEY_CONTENT...\
-----END RSA PRIVATE KEY-----"
(personal key text, the string "\" (Unix line) or "^" (Windows line) is used for line break, depending on the environment.)
responseFormatType No String - Format type of the response result
Options: xml | json
Default: xml

Response

Response data type

  • RootPassword type
RootPassword extends CommonResponse
private String rootPassword;

Examples

Request examples

ncloud vserver getRootPassword --regionCode KR --serverInstanceNo ***4299 --privateKey "file://PATH/KEY_NAME.pem"
ncloud vserver getRootPassword --regionCode KR --serverInstanceNo ***4299 --privateKey "https://URL/KEY_NAME.pem"
ncloud vserver getRootPassword --regionCode KR --serverInstanceNo ***4299 --privateKey \
"-----BEGIN RSA PRIVATE KEY-----\
...KEY_CONTENT...\
-----END RSA PRIVATE KEY-----"

Response examples

<getRootPasswordResponse>
  <requestId></requestId>
  <returnCode>0</returnCode>
  <returnMessage>success</returnMessage>
  <rootPassword>P3e7fLnd6=***</rootPassword>
</getRootPasswordResponse>