Configuration Basics · Topic 2 of 5

User Accounts, Login Classes and Authentication

Learn Junos user accounts, the predefined login classes, custom permissions, RADIUS, TACACS+ and authentication-order behavior for JNCIA-Junos JN0-106.

  • 5 min
In a nutshell
  • Every user must have a class; root uses system root-authentication.
  • super-user = all; operator = clear, network, reset, trace, view; read-only = view; unauthorized = none.
  • Custom classes use permissions, allow-commands, deny-commands and idle-timeout.

What it is

A user account lets a person log in to a Junos device. Every account belongs to exactly one login class, and the class decides which commands and configuration the user may use.

The authentication method decides who checks the password: the device itself (local password), a RADIUS server or a TACACS+ server. The authentication-order statement sets which method Junos tries first.

User logs inauthentication orderRADIUSTACACS+|or local passwordacceptedLogin classpermissionsAllowed commands

How it works

User accounts

Accounts live under [edit system login].

[edit system login]
user@R1# set user nancy class super-user
user@R1# set user nancy full-name "Nancy Smith"
user@R1# set user nancy authentication plain-text-password
New password:
Retype new password:
StatementPurpose
classThe login class; required for every user
full-nameA description of the user
uidThe numeric user ID; Junos assigns one if you leave it out
authentication plain-text-passwordPrompts for a password and stores only its hash
authentication encrypted-passwordEnters an already hashed password
authentication ssh-rsaAdds an SSH public key for key-based login

The root account is special. It is configured under system root-authentication, not under system login, and it always has full access.

Predefined login classes

ClassPermissionsTypical user
super-userallAdministrators
operatorclear, network, reset, trace, viewOperations staff
read-onlyviewAuditors and monitoring staff
unauthorizedNoneAccounts that should not run anything

An operator can view status, clear statistics, ping and traceroute, and restart software processes, but cannot change the configuration. A read-only user can only view.

Custom login classes

You build your own class under [edit system login class] from permission flags and optional command filters.

[edit system login]
user@R1# set class NOC permissions [ view clear network ]
user@R1# set class NOC idle-timeout 15
user@R1# set class NOC deny-commands "request system reboot"
user@R1# set user bob class NOC authentication plain-text-password
Class statementEffect
permissionsPermission flags such as view, view-configuration, configure, interface, routing, clear, network, reset, maintenance, shell, all
allow-commandsA regular expression of commands to allow beyond the flags
deny-commandsA regular expression of commands to deny even if the flags allow them
allow-configuration and deny-configurationThe same idea for configuration hierarchies
idle-timeoutMinutes of inactivity before the session is closed

allow-commands and deny-commands override the permission flags. This lets you give a broad flag and then carve out a single dangerous command.

Exam tip

Permission flags come in pairs. A flag such as interface lets the user view that part of the configuration, while the matching interface-control flag lets the user change it.

Authentication methods

MethodWhere the password is checkedConfigured with
Local passwordOn the device, in system loginpassword in the order
RADIUSA RADIUS serverset system radius-server <address> secret <secret>
TACACS+A TACACS+ serverset system tacplus-server <address> secret <secret>

The default authentication-order is local password only. To use a server, list it first.

[edit system]
user@R1# set radius-server 10.1.1.10 secret "S3cret"
user@R1# set authentication-order [ radius password ]

How the authentication order behaves

Authentication orderServer rejects the passwordAll servers unreachable
[ password ] (default)Not usedNot used
[ radius ]Login failsLocal password is tried
[ radius password ]Local password is triedLocal password is tried

The key rule: if password is not in the order, the local password is used only when no server answers. If password is in the order, it is also tried after a server rejects the login.

Logintry RADIUSRejectedpassword in orderCheck local passwordLogintry RADIUSNo server answersCheck local password

Remote users without a local account

A user who exists only on the RADIUS or TACACS+ server still needs a login class on the device. Junos maps such users to a local template account named remote, so set system login user remote class operator gives every server-only user the operator class. The server can also name a specific local template account for the user.

Common mistakes

Configuring root under system login. The root password belongs under system root-authentication. Other accounts belong under system login user.

Thinking operator can configure. The operator class has no configure permission. It can view, clear, use network tools, reset processes and trace.

Expecting a local fallback after a RADIUS reject. With [ radius ] only, a rejected password means the login fails. The local password is tried only when no RADIUS server answers.

Forgetting the class for remote users. A server-authenticated user with no matching local account needs the remote template user, or the login has no class to use.

Watch out

Keep a local super-user account with a known password. If every RADIUS server is down and your order has no fallback you understand, you can lock everyone out.

What to remember for the exam

  • Every user must have a class; root uses system root-authentication.
  • super-user = all; operator = clear, network, reset, trace, view; read-only = view; unauthorized = none.
  • Custom classes use permissions, allow-commands, deny-commands and idle-timeout.
  • allow-commands and deny-commands override permission flags.
  • Default authentication order is local password only.
  • Without password in the order, local is used only if all servers are unreachable; with it, local is also tried after a reject.
  • Server-only users map to the local remote template account.

Check yourself

  • Which predefined class has only the view permission?

    The read-only class. It can view but not clear, reset or configure.

  • With authentication-order [ radius ], the RADIUS server rejects a password. Is the local password tried?

    No. The login fails; the local password is tried only when no RADIUS server responds.

  • How do you stop a class from rebooting the device while keeping its other permissions?

    Add a deny-commands regular expression such as "request system reboot" to the class.

Topic 2 of 5 in Configuration Basics

Test yourself on Configuration Basics

The full Juniper JNCIA-Junos JN0-106 question bank has 1,155 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Juniper. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.