Thursday 25 October 2012

Junos : How to recover root password for Junos

  1. Reboot the system
  2. From console, interrupt the boot routine:
            Hit [Enter] to boot immediately, or any other key for command prompt.
            Booting [kernel] in 9 seconds...
     
            < Press the space bar at this point > 
     
  3. Enter into single-user mode:
            Type '?' for a list of commands, 'help' for more detailed help.
            ok  boot -s
    
    
  4. If you have the following system output, enter recovery, hit enter and skip to step 8.

    Otherwise continue with next step.
            System watchdog timer disabled
            Enter full pathname of shell or 'recovery' for root password recovery or RETURN for /bin/sh: recovery
    
    
  5. Enter the shell:
            System watchdog timer disabled
            Jan  1 00:36:47 init: /etc/spwd.db: No such file or directory
            Enter full pathname of shell or RETURN for /bin/sh:  
       
  6. Mount the virtual file systems. (Note that it is not necessary to mount the jbase package; however the other packages still need to be mounted):
            NOTE: to go to multi-user operation, exit the single-user shell (with ^D)
            # cd /packages
            # ./mount.jbase
            Mounted jbase package on /dev/vn1...
            # ./mount.jkernel
            Mounted jkernel package on /dev/vn2...
            # ./mount.jroute
            Mounted jroute package on /dev/vn3...
     
    
  7. Enter recovery mode:
            # /usr/libexec/ui/recovery-mode
     
  8. Enter configuration mode and change the root authentication password:
            root> configure 
            Entering configuration mode
     
            [edit]
            root# set system root-authentication plain-text-password    
            New password:
            Retype new password:
    
    
  9. Commit the changes, and exit configuration mode
            [edit]
            root # commit 
            commit complete
     
            [edit]
            root@router# exit 
            Exiting configuration mode
     
            root@router> exit 
     
  10. Exit recovery mode and enter 'y' when prompted to reboot the system:
            Reboot the system? [y/n] y
            Terminated
    
    The system now reboots and changes made to root authentication are activated.

No comments:

Post a Comment

loading...