1. Ensure that you have console access to the switch.
  2. Reboot the switch and do the following depending on which Junos version the switch is running,
    1. Prior 17.3: Press any key when you see ‘Main Menu’ to avoid loading Junos.
    2. For the EX4400, do a physical reboot first, once presented with the Boot Menu, select Continue and then press Ctrl+c to go into the Main Menu in step 3.
    3. 17.3 and Onwards: Press Ctrl+c when you see the following:

FreeBSD/x86 bootstrap loader, Revision 1.1

(builder@feyrith.juniper.net, Sun Feb  4 13:06:24 PST 2018)
/
Autoboot in 1 seconds... (press Ctrl-C to interrupt)
  1. After successfully entering Main Menu, the following will be shown:
Choice:
Main Menu

1. Boot [J]unos volume
2. Boot Junos volume in [S]afe mode

3. [R]eboot

4. [B]oot menu
5. [M]ore options
  1. Press either “M” or “5” for “[M]ore options” to see the Options Menu as follows:
Choice:
Options Menu

1. Recover [J]unos volume
2. Recovery mode - [C]LI
3. Check [F]ile system

4. [B]oot prompt

5. [M]ain menu
  1. In this menu, press either “C” or “2” to choose “Recovery mode – [C]LI”. Then Junos OS will be loaded with recovery mode.
Choice:
Booting Junos in CLI recovery mode ...

~snip~

NOTE: Once in the CLI, you will need to enter configuration mode using
NOTE: the 'configure' command to make any required changes. For example,
NOTE: to reset the root password, type:
NOTE: configure
NOTE: set system root-authentication plain-text-password
NOTE: (enter the new password when asked)
NOTE: commit
NOTE: exit
NOTE: exit
NOTE: When you exit the CLI, you will be in a shell.
Starting CLI ...

warning: This chassis is operating in a non-master role as part of a virtual-chassis (VC) system.
warning: Use of interactive commands should be limited to debugging and VC Port operations.
warning: Full CLI access is provided by the Virtual Chassis Master (VC-M) chassis.
warning: The VC-M can be identified through the show virtual-chassis status command executed at this console.
warning: Please logout and log into the VC-M to use CLI.

{linecard:0}
root>
  1. Set the root password as guided below:
{linecard:0}
root> configure
Entering configuration mode
The configuration has been changed but not committed

{linecard:0}[edit]
root# set system root-authentication plain-text-password
New password:
Retype new password:

{linecard:0}[edit]
root# commit
2017-02-01 18:09:37 UTC: Running FIPS Self-tests
veriexec: no signatures for device. file='/sbin/kats/cannot-exec' fsid=167 fileid=51404 gen=1 uid=0 pid=3262
2017-02-01 18:09:38 UTC: FIPS Self-tests Passed
commit complete
  1. After saving the configuration, exit from CLI so that the system is rebooted again with the saved password.
{linecard:0}
root> exit

NOTE: Type 'exit' to restart the system.
# exit
Waiting (max 60 seconds) for system process `vnlru' to stop...done
Waiting (max 60 seconds) for system process `bufdaemon' to stop...done
Waiting (max 60 seconds) for system process `syncer' to stop...
Syncing disks, vnodes remaining...0 0 0 0 0 done
All buffers synced.
Uptime: 1m17s
usbus0: controller did not stop
Khelp module "jsocket" can't unload until its refcount drops from 1 to 0.
Rebooting...
cpu_reset: Stopping other CPUs
Consoles: serial port
BIOS drive C: is disk0
BIOS drive D: is disk1

~snip~

No core dumps found.
Prefetch chassisd....
Starting jlaunchhelperd.
Wed Feb  1 18:11:24 UTC 2017 platform_fixups: 3719 3732
Wed Feb  1 18:11:24 UTC 2017 platform_fixups: Give sighup to (pid:3719) parse new file ...
/etc/rc: WARNING: run_rc_command: cannot run
Starting cron.

Wed Feb  1 18:11:24 UTC 2017

FreeBSD/amd64 (Amnesiac) (ttyu0)

login: Feb  1 18:11:24 jlaunchd: exec_command: /usr/sbin/eventd (PID 3761) started
Feb  1 18:11:24 jlaunchd: event-processing (PID 3761) started
Feb  1 18:11:24 jlaunchd: exec_command: /usr/sbin/sdk-mgmtd (PID 3762) started
Feb  1 18:11:24 jlaunchd: app-engine-management-service (PID 3762) started
Feb  1 18:11:24 jlaunchd: exec_command: /usr/sbin/sdk-vmmd (PID 3763) started
Feb  1 18:11:24 jlaunchd: app-engine-virtual-machine-management-service (PID 3763) started
Feb  1 18:11:24 jlaunchd: exec_command: /usr/sbin/vccpd (PID 3764) started
Feb  1 18:11:24 jlaunchd: virtual-chassis-control (PID 3764) started
Feb  1 18:11:24 jlaunchd: can not access /usr/sbin/chassism: No such file or directory
Feb  1 18:11:25 jlaunchd: chassis-manager (PID 0) started


FreeBSD/amd64 (Amnesiac) (ttyu0)

login: root
Password:
Last login: Wed Feb  1 15:40:16 on ttyu0
  1. Check if you can log in to the system with the new password.