There may be instances when the root password needs to be recovered. This article provides step-by-step details for root password recovery on PTX platforms.
Note: This procedure is to be performed only when all super users are locked out of the system. If any super user access is available, then the root password can be recovered by using the Command Line Interface.
Before beginning the recovery process, note the following:
Console access is required.
This procedure is specific to PTX platforms and is different from other platforms.
To recover the root password, perform the following steps:
Plug one end of the Ethernet rollover cable that is supplied with the router into the RJ-45–to–DB-9 serial port adapter that is 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 management device (laptop or desktop).
On the management device, start an 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 and verify that the power LED on the front panel is green. The terminal emulation screen on the management device displays the router’s boot sequence.
BIOS drive C: is disk0 BIOS drive D: is disk1 BIOS drive E: is disk2 BIOS 639kB/3668984kB available memory FreeBSD/x86 bootstrap loader, Revision 1.1 ([email protected], Thu Jun 14 14:21:45 PDT 2018) [KAutoboot in 3 seconds... (press Ctrl-C to interrupt) [H[KAutoboot in 2 seconds... (press Ctrl-C to interrupt) [H[K[H[JMain Menu
Important Note: Press Ctrl-C only after the above appears on the screen.
Boot [J]unos volume
Boot Junos volume in [S]afe mode
[R]eboot
[B]oot menu
[M]ore options
Choice: 5
When option 5 is selected, additional options will appear. Select option 2 to enter Recovery mode:
Recover [J]unos volume
Recovery mode - [C]LI
Check [F]ile system
Enable [V]erbose boot
[B]oot prompt
[M]ain menu
Choice: 2
Booting Junos in CLI recovery mode ... Booting [/packages/sets/active/boot/os-kernel/kernel]... ###########################################\n # Platform schema file is not available! #\n # Attrib_mode is mistakenly set?? #\n # JUNOS booting without creating Db #\n ###########################################\n @ 1565604994 [2019-08-12 10:16:34 UTC] mgd start Starting MGD
Note: Before you enter into the CLI, the system may prompt for authentication. Use root as the username and press Enter (blank password) when prompted for a password.
root
Starting CLI ... root> root> Enter in to the configuration mode in CLI root> configure Entering configuration mode Set the root password [edit] root# set system root-authentication plain-text-password
New password: Retype new password:
root# commit commit complete [edit] root@PTX# show compare rollback 1 [edit system root-authentication] - encrypted-password "$ABC123"; ## SECRET-DATA + encrypted-password "$ABC123"; ## SECRET-DATA
Note: When you configure a plain-text password, Junos OS encrypts the password for you.
[edit] root@PTX# exit Exiting configuration mode
y
root@PTX> request system reboot Reboot the system ? [yes,no] (no) yes Aug 12 10:17:54 shutdown: reboot requested by root at Mon Aug 12 10:17:54 2019 Shutdown NOW!
root@PTX> request system reboot
Reboot the system ? [yes,no] (no) yes Aug 12 10:17:54 shutdown: reboot requested by root at Mon Aug 12 10:17:54 2019 Shutdown NOW!