How to Recover the Root Password for Junos OS Evolved
This procedure resets the root password without resetting the device configuration to the factory default configuration. Only the root password is reset. This procedure does not affect the device state or any other function.
How to Connect to the Serial Port
The first task in the password reset operation is to connect to the serial port of the device.
To connect to the serial port:
- Power off the router by pressing the power button on the front panel.
- Turn off the power to the management device (usually a computer) that you will 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.
How to Recover the Root Password
The password reset operation is triggered early in the boot process. You reset the password in the shell.
To recover the root password:
- Do a hard reboot of the Routing Engine (that is, shut down the
OS, power off the device, and then power on the device).
On the terminal, you will see the following screen:
GNU GRUB version 2.02~beta3 +--------------------------------------------------------------------+ |*Primary ptx-fixed-19.1-16 | | Primary [Recover password] | | Primary-Rollback ptx-fixed-19.1-15 | | Primary-Rollback [Recover password] | | | | | | | | | | | | | | | | | +--------------------------------------------------------------------+ Use the ^ and v keys to select which entry is highlighted. Press enter to boot the selected OS, `e' to edit the commands before booting or `c' for a command-line. - Use the arrow keys to scroll down to the
Primary [Recover password]option, and press Enter.Disk boot ... IMA is 0 Loading kernel ...ok. Loading initrd ...ok. Booting ... [ 0.791088] Failed to find cpu0 device node Processing /dev/sda2 for mount on /soft ...[checking]..ok [mounting]..done Processing /dev/sda5 for mount on /data ...[checking]..ok [mounting]..done Processing /dev/sda6 for mount on /data/config ...[checking]..ok [mounting]..done Processing /dev/sda7 for mount on /data/var ...[checking]..ok [mounting]..done mkswap: /dev/sda3: warning: wiping old swap signature. Setting up swapspace version 1, size = 4 GiB (4294963200 bytes) no label, UUID=7d905478-773b-41e5-8f1d-8166ec03f93a Processing /dev/sda1 for mount on /boot ...[checking]..ok [mounting]..done Done with local filesystems setup. Mounting version junos-linux-install-ptx-x86-64-16.2I20180502181332_evo-builder...done. System is running with minimal count of software versions modprobe: FATAL: Module jnx_cbd_fpga_ptx21k not found in directory /lib/modules/4.8.24-WR2.2.1_standard Installing kexec kernel...Cannot get kernel page_offset_base symbol address done Password recovery in progress. Please enter new password.
- Enter the new password, and then retype the new password and
press Enter.
New password: Retype new password: passwd: password updated successfully Password recovery done Welcome to Linux!
The reboot proceeds until the login prompt appears.
[ OK ] Started Serial Getty on ttyS0. [ OK ] Reached target Login Prompts. [ OK ] Started Vsftpd ftp daemon. [ OK ] Started Network Time Service. [ OK ] Started strongSwan IPsec IKEv1/IKEv2 daemon using swanctl. [ OK ] Started Arp filtering arptables. [ OK ] Started Management Ethernet Interface Manager Service. [ OK ] Started OFP on RE. Starting MGD initialization of schema and database on RE... Juniper Linux Distribution 2.2.1 re0 ttyS0 re0 login: -
At the prompt, log in as root using the new password.
You will see a shell prompt.
Last login: Mon May 7 13:09:08 PDT 2018 from xxxx --- JUNOS builder Linux re0 4.8.24-WR2.2.1_standard #1 SMP PREEMPT Mon Apr 9 13:21:32 PDT 2018 x86_64 x86_64 x86_64 GNU/Linux root@RE0:~#
- To start the CLI, enter
cli.