Junos Missing Root Authentication

When working with a Junos device that has a factory default configuration, you will sometimes see the following error message when trying to commit changes:

lab@vMX-1# commit 
[edit]
  'system'
    Missing mandatory statement: 'root-authentication'
error: commit failed: (missing mandatory statements)

[edit]
lab@vMX-1#

This means no root password has been set. You can set one with the command below:

set system root-authentication plain-text-password

Note that the password will be encrypted in the configuration file. The plain-text-password specifies the format that the password will be entered in. In this case plain text rather than already encrypted.

The following example shows the error, and displays the system hierarchy, which also tells us there is a missing mandatory statement. We then set the password and commit the change.

[edit]
lab@vMX-1# commit 
[edit]
  'system'
    Missing mandatory statement: 'root-authentication'
error: commit failed: (missing mandatory statements)

[edit]
lab@vMX-1# show system 
syslog {
    file messages {
        any notice;
        authorization info;
    }
    file interactive-commands {
        interactive-commands any;
    }
}
## Warning: missing mandatory statement(s): 'root-authentication'

[edit]
lab@vMX-1# set system root-authentication plain-text-password 
New password:
Retype new password:

[edit]
lab@vMX-1# show system 
root-authentication {
    encrypted-password "<Password String Removed>"; ## SECRET-DATA
}
syslog {
    file messages {
        any notice;
        authorization info;
    }
    file interactive-commands {
        interactive-commands any;
    }
}

[edit]
lab@vMX-1# commit 
commit complete

[edit]
lab@vMX-1#

Leave a Comment

Your email address will not be published. Required fields are marked *