Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


Recovering the Root Password for MX80


Use the password recovery procedure to reset the root password for MX80 Series routers if the standard method (Configuring the Root Password) fails. The difference between this method and the standard one is that here, you will manually edit the Junos configuration file to remove the lines associated with the existing (unknown) password. Console access is required in order to reset the root password, and you will need the rollover cable that was supplied with the router, a management device such as a laptop with a serial port, and a terminal emulator such as HyperTerminal (for Windows).

To recover the root password:

  1. Physically power off the router using power button on the front panel.
  2. Connect one end of the rollover cable to the RJ-45–to–DB-9 serial port adapter on the router, and the other end to the serial port of the management device.
  3. On the management device, run the terminal emulator and select the COM port the rollover cable is connected to.
  4. Use the following port settings:
    • Bits per second: 9600

    • Data bits: 8

    • Parity: None

    • Stop bits: 1

    • Flow control: None

  5. Physically power on the router (that is, use the power button), and wait until you see the green LED. On the laptop, you should also begin to see boot sequence commands appear in the terminal emulator.
  6. Watch for the prompt to interrupt the normal boot sequence by pressing the spacebar, and when you see it, press the spacebar to get a command prompt:

    The boot sequence may happen quickly, and may not pause for input. If so, press the spacebar a few times at the beginning of the boot sequence to catch the interrupt and boot to the loader prompt.

  7. At the loader prompt, type boot -s to start the system in single-user mode.

    The router will continue to boot and then pause so you can enter the password recovery sequence.

  8. Type recovery when prompted, and then hit Enter:

    The router will again continue to boot and then come to the root command prompt.

  9. At the root prompt, run the shell so you can access the active configuration file:
  10. Change to the folder where the Junos configuration files are stored:
  11. Unzip the configuration file:
  12. Type the Linux command below to learn which lines contain the root-authentication configuration so you know which ones to delete. In this example, we learn that the pertinent configuration starts on line 28:
  13. There are three lines related to root-authentication. Use the native VI editor to delete them, as shown here:
  14. Confirm the deletion by grepping root-authentication again (this time nothing should be returned):
  15. Recompress the configuration file:
  16. Start the Junos OS CLI:
  17. Reboot the router:
  18. Log in as root after the router restarts (no password is needed at this time, so just hit Enter), and then start the CLI:
  19. Enter configuration mode and set a new password using plain text (when you configure a plain-text password, Junos OS automatically encrypts the password. Do not use the encrypted-password option, which is only for entering the encrypted form of known password).
  20. Commit the change, and, optionally, reboot the router:
    root@host# commit