Description

This article describes how to recover root password in vSRX within kernel-based virtual machine (KVM) environment.

Solution

Steps to recover the root password in KVM environment:

  1. Reboot the vSRX instance using virsh utility:   virsh reboot {domain-id or domain-name}

  2. Immediately try login to the same instance using domain-name because domain-id may change after the reboot :  virsh console domain-name

  3. After login, you will see a prompt like Escape character is ^] . Press enter a couple of times and you will see the boot process.

  4. Let it boot until wind river Linux and the time you see the following prompt:

    Hit [Enter] to boot immediately, or space bar for command prompt. Booting [kernel] in 9 seconds...

  5. Press the space bar and break to boot sequence. Then type boot -s to login to single user mode:

    alt

     

  6. At the following prompt, type recovery to start the root password recovery procedure.

    Enter full pathname of shell or 'recovery' for root password recovery or RETURN for /bin/sh: recovery

  7. Once this script ends, you will be in vSRX operational mode.

  8. Change to configuration mode using edit or config command.

  9. Set a new password  as :  set system root-authentication plain-text-password

    New password:  <-- Configure password here and confirm in next step.

  10. Commit the change and enter: commit

  11. Exit from config mode and reboot the vSRX:
          #exit
          > request system reboot
             Reboot the system? [y/n] y

  12. Now, you should be able to login with the new password.