Update Local Account Passwords on NSX Edge Transport Nodes via REST API
search cancel

Update Local Account Passwords on NSX Edge Transport Nodes via REST API

book

Article ID: 453842

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

This article outlines the step-by-step REST API workflow to update local account credentials (such as admin and root) on NSX Edge Transport Nodes.

  • Credential management for local accounts on Edge Transport Nodes is a standard administrative task.
  • These passwords can be changed manually by logging into the Command Line Interface (CLI) of the edge node or via NSX REST API to perform this action.

Environment

VMware NSX

Resolution

Prerequisites

  • An user account with Enterprise Admin privileges is needed to authenticate the NSX API.
  • Provide the current (old) passwords for the accounts to change them via this API. If a password is lost, a manual recovery via the VM console GRUB menu is required. Refer to this article Resetting GRUB password on NSX Manager 
  • Please note that the new password must be at least 15 characters long and include a mix of uppercase, lowercase, numbers, and special characters.

API Workflow Steps

Step 1: Retrieve Edge Transport Node IDs

  • Execute GET request to retrieve the UUIDs of the Edge Transport Nodes.
    GET https://<nsx-manager-ip>/api/v1/transport-nodes
  • Filter the JSON response for nodes where the resource_type is EdgeNode, and copy the id of the target node.

Step 2: Retrieve User IDs

  • Execute a GET request to find the internal userid for the admin and root accounts on that specific node.
    GET https://<nsx-manager-ip>/api/v1/transport-nodes/{transport-node-id}/node/users
  • In the response, locate the users (usually, root is 0 and admin is 10000 ) and note its exact user-id values.

Step 3: Update the Passwords

  • Execute a PUT request using the specific user ID to update the password.
    PUT https://<nsx-manager-ip>/api/v1/transport-nodes/{transport-node-id}/node/users/{userid}
  • Ensure the header includes Content-Type: application/json and use the following JSON payload structure:
{
  "password": "<NewPassword>",
  "old_password": "<CurrentPassword>"
}
  • A 200 OK HTTP status code will confirm that the password was updated successfully.

Additional Information

API Guide

API Command

Resetting the Passwords of an Appliance