How to Recover a Password for a NetScaler Appliance
At times, you might need to recover the password for a NetScaler appliance if the user of the appliance has forgotten the same. To recover the password for the NetScaler appliance, complete the following procedure:
- Attach a console cable to the Serial Console (9600 baud, 8 bits, 1 stop bit, No parity) of the NetScaler appliance.
- Restart the NetScaler appliance.
- Press any of the following keys, as prompted:
PressÂ Spacebar when the following message is displayed:
- Hit [Enter] to boot immediately, or any other key for command prompt Booting [kernel] in 10 seconds
PressÂ Ctrl andÂ C keys simultaneously when the following message is displayed:
Press [Ctrl-C] for command prompt, or any other key to boot immediately.
Booting [kernel] in 2 seconds…
- To start the appliance kernel on a single user mode, enter the following command:
- boot â€“sNote: IfÂ boot -s does not work, then tryÂ reboot — -s and appliance will reboot in single user mode.
- PressÂ Enter when the following message is displayed:
- Enter full pathname of shell or RETURN for /bin/sh:Note: Notice that the prompt of the appliance changes to \u@\h\$.
- Run the following command to check the disk consistency:
- \u@\h\$ /sbin/fsck /dev/ad0s1aNote: Refer to the Knowledge Center article CTX121853 â€“Â Device Names Assigned to Hard Disk in Various Models of the Citrix NetScaler Appliance to verify the device name assigned to the hard disk of the appliance model and replace ad0s1a in the preceding command with the appropriate device name.
- Run the following command to display the mounted partitions:
- Run the following command to mount the flash drive:
- \u@\h\$ /sbin/mount /dev/ad0s1a /flashIf the preceding command fails to mount the flash drive, then run the following command to create the flash directory and then run the preceding command again to mount the drive:\u@\h\$ mkdir /flash
- Run the following command to change to the nsconfig directory:
- \u@\h\$ cd /flash/nsconfig
- Run the following set of commands to rewrite the ns.conf file and remove the set of system commands defaulting to the nsroot user:
a. Run the following command to create a new configuration file that does not have commands defaulting to the nsroot user:
\u@\h\$ grep â€“v â€œset system user nsrootâ€ ns.conf > new.conf
b. Run a command similar to the following command to make a backup of the existing configuration file:
\u@\h\$ mv ns.conf old.ns.conf
c. Run the following command to rename the new.conf file to ns.conf:
\u@\h\$ mv new.conf ns.conf
- Run the following command to restart the appliance:
- Log in to the appliance by using the default nsroot user credentials.
- Run the following command to reset the nsroot user password of your choice:
- > set system user nsroot <New_Password>