VMware NSX-T LogoVMware NSX-T Logo

Introduction

This page contains useful SSH commands for the NSX Manager in NSX 4.x environments.

User Management

Get password expiration of an existing NSX user in NSX 4.x

To list the current password expiration date of an existing user, run the following command on the NSX Manager CLI.
In this example I will list the password expiration for user marc.

get user marc password-expiration

Increase password expiration date of an existing NSX user in NSX 4.x

To increase the current password expiration date of an existing user, run the following command on the NSX Manager CLI.

Note:
If you are using VMware Cloud Foundation prior to VCF 4.3, the removal of password expiration could lead to issues when you perform an upgrade. If you are using VMware Cloud Foundation, you can change the password expiration date to a value of < 9999 days.
Check these KB articles for more information: KB84190 / KB83855.

In this example I will change the password expiration date to 10 years (3.650 days) for the admin, root and audit account.

set user root password-expiration 3650
set user admin password-expiration 3650
set user audit password-expiration 3650
#
# Validate Password Expiration Change
#
get user root password-expiration
get user admin password-expiration
get user audit password-expiration

Remove password expiration date of an existing NSX user in NSX 4.x

To remove the current password expiration date of an existing user, run the following command on the NSX Manager CLI.
In this example I will clear the password expiration date for the admin, root and audit account.

clear user root password-expiration
clear user root password-expiration
clear user root password-expiration
#
# Validate Password Expiration Change
#
get user root password-expiration
get user admin password-expiration
get user audit password-expiration

Change the default warning message time for an existing NSX user in NSX 4.x

Use the following command to change the default number of days an existing NSX user receives a warning message prior to their password expiration. Default is 7. Range is 1 to 1999.

In this example I will change the default warning message time of user marc from 7 to 31 days.

set user marc password-expiration-warning 31

Change the username of an existing NSX user in NSX 4.x

To change the username of an existing NSX user, run the following command on the NSX Manager CLI.
In this example I will change the username for marc to marc1.

set user marc username marc1

Change the password of an existing NSX user in NSX 4.x

To change the password of an NSX user, run the following command on the NSX Manager CLI.
In this example I will change the password for Marc to nsx@VMWARE2023

set user marc password nsx@VMWARE2023

NTP Server

List all current NTP sources in NSX 4.x

I need to check out which NTP servers are currently configured before I start adding or removing NTP servers.
In this example I will run the following command on the NSX Manager CLI to list the NTP servers currently configured.

get ntp-server

Add a new NTP time server in NSX 4.x

Run the following command on the NSX Manager CLI to add a new NTP source to your NSX 4.x environment.
In this example I will add Google’s public NTP server > time.google.com and check if the change was successful.

set ntp-server time.google.com
#
# Validate NTP Server Change
#
get ntp-server 

Remove existing NTP sources in NSX 4.x

Run the following command on the NSX Manager CLI to remove existing NTP sources from your NSX 4.x environment.
In this example I will remove nl.pool.ntp.org from my existing configuration and check if the change was successful.

del ntp-server 0.nl.pool.ntp.org
del ntp-server 1.nl.pool.ntp.org
del ntp-server 2.nl.pool.ntp.org
del ntp-server 3.nl.pool.ntp.org
#
# Validate NTP Server Change
#
get ntp-server

DNS Server

List all current DNS name servers in NSX 4.x

I need to check out which DNS servers currently configured before I start adding or removing DNS servers.
In this example I will run the following command on the NSX Manager CLI to list the DNS servers currently configured on the NSX Manager CLI.

get name-servers

Add new DNS name servers in NSX 4.x

In this example I will run the following command on the NSX Manager CLI to add two new name servers (192.168.100.101 & 192.168.100.102) to the NSX Manager.

set name-servers 192.168.100.101
set name-servers 192.168.100.102
#
# Validate DNS Server Change
#
get name-servers

Remove existing DNS name servers in NSX 4.x

In this example I will run the following command on the NSX Manager CLI to remove two existing new name servers (192.168.100.101 & 192.168.100.102) from the NSX Manager.

del name-servers 192.168.100.101 
del name-servers 192.168.100.102
#
# Validate DNS Server Change
#
get name-servers

Loading

By Marc Roeleveld

VCDX-DCV #299 | Cloud Architect | Owner at Roeleveld Cloud Services

Leave a Reply

Your email address will not be published. Required fields are marked *