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
- 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-commandsandidle-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.
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:
| Statement | Purpose |
|---|---|
class | The login class; required for every user |
full-name | A description of the user |
uid | The numeric user ID; Junos assigns one if you leave it out |
authentication plain-text-password | Prompts for a password and stores only its hash |
authentication encrypted-password | Enters an already hashed password |
authentication ssh-rsa | Adds 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
| Class | Permissions | Typical user |
|---|---|---|
super-user | all | Administrators |
operator | clear, network, reset, trace, view | Operations staff |
read-only | view | Auditors and monitoring staff |
unauthorized | None | Accounts 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 statement | Effect |
|---|---|
permissions | Permission flags such as view, view-configuration, configure, interface, routing, clear, network, reset, maintenance, shell, all |
allow-commands | A regular expression of commands to allow beyond the flags |
deny-commands | A regular expression of commands to deny even if the flags allow them |
allow-configuration and deny-configuration | The same idea for configuration hierarchies |
idle-timeout | Minutes 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.
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
| Method | Where the password is checked | Configured with |
|---|---|---|
| Local password | On the device, in system login | password in the order |
| RADIUS | A RADIUS server | set system radius-server <address> secret <secret> |
| TACACS+ | A TACACS+ server | set 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 order | Server rejects the password | All servers unreachable |
|---|---|---|
[ password ] (default) | Not used | Not used |
[ radius ] | Login fails | Local password is tried |
[ radius password ] | Local password is tried | Local 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.
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.
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-commandsandidle-timeout. allow-commandsanddeny-commandsoverride permission flags.- Default authentication order is local password only.
- Without
passwordin 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
remotetemplate 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-commandsregular 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.