Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Junos OS User Accounts Overview

User accounts provide one way for users to access the router. (Users can access the router without accounts if you configured RADIUS or TACACS+ servers, as described in Junos OS User Authentication Methods.) For each account, you define the login name for the user and, optionally, information that identifies the user. After you have created an account, the software creates a home directory for the user.

For each user account, you can define the following:

  • Username—Name that identifies the user. It must be unique within the router. Do not include spaces, colons, or commas in the username. The username can be up to 64 characters long.
  • User’s full name—(Optional) If the full name contains spaces, enclose it in quotation marks. Do not include colons or commas.
  • User identifier (UID)—(Optional) Numeric identifier that is associated with the user account name. The identifier must be in the range from 100 through 64,000 and must be unique within the router. If you do not assign a UID to a username, the software assigns one when you commit the configuration, preferring the lowest available number.

You must ensure that the UID is unique. However, it is possible to assign the same UID to different users. If you do this, the CLI displays a warning when you commit the configuration and then assigns the duplicate UID.

  • User’s access privilege—(Required) One of the login classes you defined in the class statement at the [edit system login] hierarchy level, or one of the default classes listed in Regular Expressions for Allowing and Denying Junos OS Configuration Mode Hierarchies.
  • Authentication method or methods and passwords that the user can use to access the router—(Optional) You can use SSH or a Message Digest 5 (MD5) password, or you can enter a plain-text password that the Junos OS encrypts using MD5-style encryption before entering it in the password database. For each method, you can specify the user’s password. If you configure the plain-text-password option, you are prompted to enter and confirm the password:
    [edit system login user username]user@host# set authentication plain-text-passwordNew password: type password hereRetype new password: retype password here

    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.

    Junos-FIPS and Common Criteria have special password requirements. FIPS and Common Criteria 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, you cannot configure passwords unless they meet this standard.

For SSH authentication, you can copy the contents of an SSH key file into the configuration or directly configure SSH key information. Use the load-key-file URL filename command to load an SSH key file that was previously generated, e.g. by using ssh-keygen. The URL filename is the path to the file’s location and name. This command loads RSA (SSH version 1 and SSH version 2) and DSA (SSH version 2) public keys. The contents of the SSH key file are copied into the configuration immediately after you enter the load-key-file statement. Optionally, you can use the ssh-dsa public key <from hostname> and the ssh-rsa public key <from hostname> statements to directly configure SSH keys.

For each user account and for root logins, you can configure more than one public RSA or DSA key for user authentication. When a user logs in using a user account or as root, the configured 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:

[edit system login user boojum]user@host# set authentication load-key-file my-host:.ssh/id_dsa.pub.file.19692 | 0 KB | 0.3 kB/s | ETA: 00:00:00 | 100%[edit system]user@host# show
root-authentication {ssh-rsa "1024 35 9727638204084251055468226757249864241630322
207404962528390382038690141584534964170019610608358722961563
475784918273603361276441874265946893207739108344813125957722
625461667999278316123500438660915866283822489746732605661192
181489539813862940327687806538169602027491641637359132693963
44008443 boojum@juniper.net"; # SECRET-DATA
}

An account for the user root is always present in the configuration. You configure the password for root using the root-authentication statement, as described in Configuring the Root Password.

Published: 2013-02-22