Reset the root password on a Juniper.

Let’s take a look how to reset the root password on a Junos based device.
First, we need to get access to the bootstrap loader command prompt. Don’t miss this prompt.
Hit [Enter] to boot immediately, or space bar for command prompt.
This is where you would press the “space bar”.

In operational mode, disable the watchdog functionality and start the system in single-user mode.
loader> watchdog disable
loader> boot -s

The device will continue to boot and at the following prompt,
Enter full pathname of shell or 'recovery' for root password recovery or RETURN for /bin/sh:
we’re gonna go ahead and type recovery to start the root password recovery procedure.
Once the device has completed booting you should see the CLI prompt and it will look something like that:
Starting CLI ...
root>

and then we just need to go into configuration mode and set the root password.
root> configure
root# set system root-authentication plain-text-password

Finally, let’s save the configuration and reboot the device.
root# commit and-quit
root> request system reboot

That’s all, end of story.