Supported Platforms
Recovering the Root Password
If you forget the root password for the router, you can use the password recovery procedure to reset the root password.
![]() | Note: You need console access to recover the root password. |
Video 1: Recovering the Root Password

To recover the root password:
- Power off the router by pressing the power button on the front panel.
- Turn off the power to the management device, such as a PC or laptop computer, that you want to use to access the CLI.
- Plug one end of the Ethernet rollover cable supplied with the router into the RJ-45–to–DB-9 serial port adapter supplied with the router.
- Plug the RJ-45–to–DB-9 serial port adapter into the serial port on the management device.
- Connect the other end of the Ethernet rollover cable to the console port on the router.
- Turn on the power to the management device.
- On the management device, start your asynchronous terminal emulation application (such as Microsoft Windows Hyperterminal) and select the appropriate COM port to use (for example, COM1).
- Configure the port settings as follows:
- Bits per second: 9600
- Data bits: 8
- Parity: None
- Stop bits: 1
- Flow control: None
- Power on the router by pressing the power button on the
front panel.
Verify that the POWER LED on the front panel turns green.
The terminal emulation screen on your management device displays the router’s boot sequence.
- When the following prompt appears, press the Spacebar
to access the router’s bootstrap loader command prompt:
Depending on your device hardware, the bootstrap loader might proceed quite quickly at this step without pausing for input. Therefore, you might need to press the spacebar multiple times at the beginning of the boot sequence.
Hit [Enter] to boot immediately, or space bar for command prompt. Booting [kernel] in 9 seconds...
- At the following prompt, type boot -s to start
the system in single-user mode.
ok boot -s
- 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
- Enter configuration mode in the CLI.
- Set the root password.
When you configure a plain-text password, Junos OS encrypts the password for you.
Caution: Do not use the encrypted-password option unless the password is already encrypted, and you are entering the encrypted version of the password. If you commit the encrypted-password option with a plain-text password or with blank quotation marks (" "), you will not be able to log in to the device as root, and you will need to repeat this password recovery process.
Optionally, instead of configuring the root password at the [edit system] hierarchy level, you can use a configuration group, as shown in this procedure. This is a recommended best practice for configuring the root password.
For example:
user@host# set groups global system root-authentication plain-text-password
- At the following prompt, enter the new root password,
for example:
New password: password
Retype new password:
- At the second prompt, reenter the new root password.
- If you used a configuration group, apply the configuration
group, substituting global with the appropriate group name.[edit]user@host# set apply-groups global
- After you have finished configuring the password, commit
the configuration.
root@host# commit
commit complete
- Exit configuration mode in the CLI.
- Exit operational mode in the CLI.
- At the prompt, type y to reboot the router.
Reboot the system? [y/n] y