I recently purchased a Juniper J2320 from eBay for a fair price. I know it is an older router, but it has the features I need in order to test and write a few things. When I received the router it was not sent with a wiped config, so I was unable to log into it upon booting.
Since I need to recover the device, figured might as well write and share how to do it!
Obviously the first thing you will need will be a Serial connection to the device. I am assuming you have a USB -> Serial adapter, if not this is the one I have and I got it from Amazon here LINK.
1. Make sure the power to the device is turned off. If it is turned on, please use the power button to force the system to shut down cleanly. If you do not do this and just yank the power, you risk corrupting the OS and having more fun later.
2. Make sure you are connected via serial to the device, your terminal window is open and connected. (9600/8/N/1)
3. Power on the device and watch the screen for the line:
Hit [Enter] to boot immediately, or space bar for command prompt.
When you see that line, hit the SPACE BAR and you will receive an OK prompt.
4. At the OK prompt, you want to the system into single user mode by issuing the command boot -s
5. The system will boot in single user mode and you will then be prompted if you want to enter the path name for shell or “recovery” for root password recovery. Since we are trying to recover the password, we will enter recovery.
6. The system will then boot and run a recovery script and place you in at the > prompt.
7. Enter the edit mode and set the new root-authentication password using the command: set system root-authentication plain-text-password
8. Go ahead and commit that config, exit from the CLI and you will be prompted to reboot the system. Go ahead and reboot the system.
9. When it comes back up you should be able to login as root with the password you just set.
Since you are logging in as root, remember that you need to enter the command cli to enter operational mode.
Now if you want to remove any prior config that was on the router, all you need to do is enter edit mode, delete the config from the top, and reset your root password.
Commit that, reboot to be sure, and you are set!
Once the router is back up you can log in with your new password. Also you will see that you are now Amnesiac!