Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[JSA] Recovering a forgotten or lost root password



Article ID: KB34990 KB Last Updated: 05 Sep 2019Version: 1.0

If you have forgotten your root password for a JSA physical or virtual appliance, you can reset your root password as long as you have access to the GRUB bootloader (console access).

This article lists the steps to do so.


Unable to log in to the Command Line Interface (CLI) of the server by using the root credentials


To recover a forgotten or lost password, perform the following steps:

  1. Boot your system and wait until the GRUB2 menu appears. Use the ‚Äč↑ or ↓ keys to interrupt the booting process.
  1. Select the first operating system (likely Red Hat Enterprise Linux Server) and then press "e" to edit.
  2. Find the line beginning with Linux. In this example, the line begins with linux16.

  1. Using the right arrow keys, append "init=/bin/sh" to the line that starts with the keyword "linux" (in this example, linux16).

  1. To reboot your system now by using the options specified, press the keys Ctrl + x. After the system has re-booted, you will be presented with a shell prompt without having to enter any username or password information.

  2. At this command prompt, you will need to enter the following commands:
    1. Remount the "/" root filesystem in Read/Write mode: 

      # mount -o remount,rw /
    2. Issue the passwd command to reset the root account password.

    3. In order to exit from the shell prompt and reboot the system, run the following command:

      #exec /sbin/init 6
  1. When your system is up, you should be able to log in with the new root password.

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search