Reset the root password on NetScaler

Reset the root password on NetScaler

This is just a short guide to reset the root password in case you lost it.

In my scenario, the VPX is installed on the VMware hypervisor. If your NetScaler is installed on another hypervisor, the steps you need to take should not be very different.

  • Start a console session in vCenter to the appliance and reboot the VPX
  • On booting the VPX press CTRL + C
  • Type boot -s to get into the single user mode and press Enter
  • Press Enter if you see the message Enter Full Pathname of shell or return for /bin/sh

Note: Your flash drive has a specific device name depending on your Citrix ADC.

  • Run the following command at the ADC CLI and copy the name ending with “1a.”
    • gpart show -p
  • Check the consistency of the flash partition
    • /sbin/fsck_ufs /dev/da0s1a
  • Mount the flash partition
    • /sbin/mount /dev/da0s1a /flash
  • To display a list of mounted partitions and confirm flash is mounted
    • Run command df
  • Run the following command to change to the nsconfig directory
    • cd /flash/nsconfig
  • Run the following commands to rewrite the ns.conf file and remove the set of system commands defaulting to the admin
    • grep -v “set system user nsroot” ns.conf > newns.conf (this command creates a new configuration file newns.conf that has a nsroot user with the default password)
    • mv ns.conf backupns.conf (this command backs up the current ns.conf file to a file called backupns.conf in case you need to restore)
    • mv newns.conf ns.conf (this command renames newns.conf to ns.conf so it is now in command of configuration)
    • reboot

When the NetScaler appliances comes back online, you can log on to the nsroot account using the default credentials.

  • Change the password via GUI or via CLI command
    • set system user nsroot (password)

Thats All!

Leave a Comment

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

Scroll to Top