Supported Platforms
Related Documentation
- ACX, M, MX, PTX, T Series
- Example: Configuring the Root Password
- Recovering the Root Password
- ACX, M, MX, PTX, T Series, QFabric System, QFX Series standalone switches
- Example: Configuring a Plain-Text Password for Root Logins
- Example: Changing the Requirements for Junos OS Plain-Text Passwords
- ACX, M, MX, T Series, QFabric System, QFX Series standalone switches
- Example: Configuring SSH Authentication for Root Logins
Configuring the Root Password
The Junos OS is preinstalled on the router or switch. When the router or switch is powered on, it is ready to be configured. Initially, you log in as the user root with no password. The root directory of a UNIX device is the entry point to all other folders and files on that device. As a result, access to the root directory is restricted by default to a predefined user account known as root user. The root user (also referred to as superuser) has unrestricted access and full permissions within the system. The expression “log in as root” is commonly used when an action requires you to log into the device as the root user.
![]() | Note: If you configure a blank password using the encrypted-password statement at the [edit system root-authentication] hierarchy level for root authentication, you can commit a configuration, but you are not able to log in as superuser and gain root level access to the router or switch. |
After you log in, you should configure the root (superuser) password by including the root-authentication statement at the [edit system] hierarchy level and configuring one of the password options:
If you configure the plain-text-password option, you are prompted to enter and confirm the password:
The default requirements for plain-text passwords are:
- The password must be between 6 and 128 characters long
- You can include most character classes in a password (uppercase letters, lowercase letters, numbers, punctuation marks, and other special characters). Control characters are not recommended.
- Valid passwords must contain at least one change of case or character class.
You can use the load-key-file URL filename statement to load an SSH key file that was previously generated using ssh-keygen. The URL filename is the path to the file’s location and name. When using this option, the contents of the key file are copied into the configuration immediately after entering the load-key-file URL statement. This command loads RSA (SSH version 1 and SSH version 2) and DSA (SSH version 2) public keys.
Optionally, you can use the ssh-dsa, ssh-ecdsa, or ssh-rsa statements to directly configure SSH RSA, DSA, or ECDSA keys to authenticate root logins. You can configure more than one public key for SSH authentication of root logins as well as for user accounts. When a user logs in as root, the public keys are referenced to determine whether the private key matches any of them.
To view the SSH keys entries, use the configuration mode show command. For example:
20740496252839038203869014158453496417001961060835872296
15634757491827360336127644187426594689320773910834481012
68312595772262546166799927831612350043866091586628382248
97467326056611921489539813965561563786211940327687806538
16960202749164163735913269396344008443 boojum@juniper.net"; #
SECRET-DATA}
Junos-FIPS software has special password requirements. FIPS passwords must be between 10 and 20 characters in length. Passwords must use at least three of the five defined character sets (uppercase letters, lowercase letters, digits, punctuation marks, and other special characters). If Junos-FIPS is installed on the router or switch, you cannot configure passwords unless they meet this standard. If you use the encrypted-password option, then a null-password (empty) is not permitted.
You cannot configure a blank password for encrypted-password using blank quotation marks (" "). You must configure a password whose number of characters range from 1 through 128 characters and enclose the password in quotation marks.
Related Documentation
- ACX, M, MX, PTX, T Series
- Example: Configuring the Root Password
- Recovering the Root Password
- ACX, M, MX, PTX, T Series, QFabric System, QFX Series standalone switches
- Example: Configuring a Plain-Text Password for Root Logins
- Example: Changing the Requirements for Junos OS Plain-Text Passwords
- ACX, M, MX, T Series, QFabric System, QFX Series standalone switches
- Example: Configuring SSH Authentication for Root Logins
Published: 2014-03-24
Supported Platforms
Related Documentation
- ACX, M, MX, PTX, T Series
- Example: Configuring the Root Password
- Recovering the Root Password
- ACX, M, MX, PTX, T Series, QFabric System, QFX Series standalone switches
- Example: Configuring a Plain-Text Password for Root Logins
- Example: Changing the Requirements for Junos OS Plain-Text Passwords
- ACX, M, MX, T Series, QFabric System, QFX Series standalone switches
- Example: Configuring SSH Authentication for Root Logins