Here's a useful Juniper link in recovering the root password.
I tried to login to my virtual MX device but couldn't access it, so I've performed a root password recovery.
vMX1
(ttyd0)
login:
root
Password:
Login
incorrect
login:
root
Password:
Login
incorrect
login:
root
Password:
Login
incorrect
vMX1
(ttyd0)
login:
// RELOAD
JUNIPER DEVICE, CONNECT TO CONSOLE
Booting
from Hard Disk...
Loading
/boot/loader
Consoles:
serial port
BIOS
drive A: is disk0
BIOS
drive C: is disk1
BIOS
639kB/1047424kB available memory
FreeBSD/i386
bootstrap loader, Revision 1.2
(builder@larth.juniper.net,
Sat Jun 7 07:19:45 UTC 2014)
Loading
/boot/defaults/loader.conf
/kernel
text=0x927168 data=0x55514+0x11417c syms=[0x4+0xa2e10+0x4+0xedc20]
/boot/modules/if_bge.ko
text=0xfeec data=0x370+0x80 syms=[0x4+0xe40+0x4+0xe12]
/boot/modules/if_em.ko
text=0x1465c data=0x7e4+0x14 syms=[0x4+0x18d0+0x4+0x1c89]
<OUTPUT TRUNCATED>
// PRESS
SPACE BAR WHEN YOU SEE THIS PROMPT
Hit [Enter] to boot immediately, or space bar for
command prompt.
Type '?'
for a list of commands, 'help' for more detailed help.
OK ?
Available
commands:
heap show heap usage
reboot reboot the system
bcachestat get disk block cache stats
autoboot boot automatically after a delay
boot boot a file or loaded kernel
nextboot set next boot device
more show contents of a file
read read input from the terminal
echo echo arguments
unset unset a variable
set set a variable
show show variable(s)
? list commands
help detailed help
install install JUNOS
include read commands from a file
ls list files
lsmod list loaded modules
unload unload all modules
load load a kernel or module
pnpscan scan for PnP devices
recover initiate recovery process from
compact flash
boot-conf load kernel and modules, then autoboot
read-conf read a configuration file
enable-module enable loading of a module
disable-module disable loading of a module
toggle-module toggle loading of a module
show-module show module load data
// TYPE boot -s
OK boot -s
platform_early_bootinit:
M/T/EX Series Early Boot Initialization
mtx_platform_set_re_type:
Found Re type 160
GDB:
debug ports: sio
GDB:
current port: sio
KDB:
debugger backends: ddb gdb
KDB:
current backend: ddb
Copyright
(c) 1996-2014, Juniper Networks, Inc.
All
rights reserved.
Copyright
(c) 1992-2007 The FreeBSD Project.
Copyright
(c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of
California. All rights reserved.
FreeBSD
is a registered trademark of The FreeBSD Foundation.
JUNOS
14.1R1.10 #0: 2014-06-07 09:37:07 UTC
builder@larth.juniper.net:/volume/build/junos/14.1/release/14.1R1.10/obj-i386/junos/bsd/kernel
Timecounter
"i8254" frequency 1193182 Hz quality 0
CPU: QEMU
Virtual CPU version 2.5+ (1895.61-MHz 686-class CPU)
Origin = "GenuineIntel" Id = 0x663
Stepping = 3
<OUTPUT TRUNCATED>
// TO INITIATE PASSWORD RECOVER TYPE recovery
Attaching
/packages/jbase via /dev/mdctl...
Mounted
jbase package on /dev/md0...
System
watchdog timer disabled
Enter
full pathname of shell or 'recovery' for root password recovery or RETURN for
/bin/sh: recovery
Performing
filesystem consistency checks ...
/dev/ad0s1a:
2685 files, 247617 used, 1608782 free (2 frags, 402195 blocks, 0.0%
fragmentation)
/dev/ad0s1e:
10 files, 8 used, 515311 free (3 frags, 128827 blocks, 0.0% fragmentation)
/dev/ad0s1f:
197 files, 15972 used, 4522583 free (67 frags, 1130629 blocks, 0.0%
fragmentation)
Performing
mount of main filesystems ...
Verified
manifest signed by PackageProductionEc_2014
Verified
boot-modules signed by PackageProductionEc_2014
Verified
jboot signed by PackageProductionEc_2014
Verified
jbase-14.1R1.10 signed by PackageProductionEc_2014
<OUTPUT TRUNCATED>
Performing
initialization of management services ...
Performing
checkout of management services ...
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 asked if you want to reboot
NOTE: the
system
// RECONFIGURE THE ROOT PASSWORD, SAVE AND REBOOT
Starting CLI ...
root> configure
Entering
configuration mode
[edit]
root# set system root-authentication plain-text-password
New
password:
Retype
new password:
[edit]
root# commit
[edit]
root#
exit
Exiting
configuration mode
root> exit
Reboot the system? [y/n] y
Waiting
(max 60 seconds) for system process `vnlru_mem' to stop...done
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 0 done
syncing
disks... All buffers synced.
Uptime:
5m36s
Normal
shutdown (no dump device defined)
Rebooting...
vMX1
(ttyd0)
login:
root
Password:
--- JUNOS
14.1R1.10 built 2014-06-07 09:37:07 UTC
root@vMX1%
cli
root@vMX1>