Juniper routers, switches and SRX firewalls sit on the paths every packet takes, so the way administrators and automation tools log in to Junos, and which management services each device answers on, decides how well the network can be defended. Junos gives the customer a precise set of controls for this: login classes, an ordered authentication chain with TACACS+ or RADIUS, per-zone host-inbound rules on SRX, firewall filters on the loopback interface and confirmed commits. This guide covers how identity and access work in Junos, privileged access, automation accounts and keys, the logs that reveal misuse, and a hardening baseline built from Juniper's own documentation and the December 2024 CISA, NSA and Five Eyes communications infrastructure guidance. It is for network engineers, firewall administrators and SOC teams. For the general edge device view, see the Edge Device Security Guide.
This is an independent guide from NHI Mgmt Group, based on Juniper's public documentation as of November 2026. It is not sponsored or reviewed by Juniper. Product features change, so confirm settings against Juniper's current documentation.
Key takeaways
- Build your own login classes. The predefined classes cannot be changed and cannot carry an idle timeout, so define custom classes with only the permission flags and command scope each role needs.
- Get the authentication order right. Junos always falls back to local passwords when no AAA server answers, but only falls back after a server rejection if
passwordis listed, so decide that behaviour deliberately. - Answer only on the management services you use. On SRX, inbound traffic to the device is dropped until
host-inbound-trafficallows it; use that, plus a loopback filter, to keep SSH, NETCONF and J-Web on the management network. - Treat automation logins as machine identities. NETCONF, configuration backup and monitoring accounts need their own users, SSH keys held in a vault, narrow classes and TACACS+ accounting.
- Log commands and commits off the device. Send the authorization, change-log and interactive-commands facilities to a remote collector and alert on changes outside change windows.
How identity and access work in Juniper Junos
Junos runs across Juniper's MX and PTX routers, EX and QFX switches and SRX Series firewalls, with Junos OS Evolved on newer platforms. Access control is defined under [edit system login] and [edit system] and works the same way across the families, with SRX adding security zones that decide which interfaces accept management traffic at all.
- Local users: each
userhas a name, UID and aclass. Therootaccount exists on every device and is protected by its own authentication statement. - Login classes: a class sets permission flags (such as
view,configure,maintenance), optional command and configuration allow or deny expressions, and an idle timeout. Every user, local or remote, is mapped to one. - Remote users and templates: a user authenticated by TACACS+ or RADIUS who has no local account is mapped to the template
user remote; all such users share that template's class and UID. The server can map a user to a different local template with the Juniperlocal-user-nameattribute for TACACS+ orJuniper-Local-User-Namefor RADIUS. - Access paths: console, SSH, NETCONF over SSH, J-Web (the web interface, over HTTP or HTTPS), SNMP, and on older or lab builds Telnet and FTP.
- Machine identities: TACACS+ and RADIUS shared secrets, SNMPv3 user keys, SSH host keys and authorised public keys for automation accounts, routing protocol keys, IPsec pre-shared keys and certificates on SRX, and the accounts used by backup, monitoring and orchestration tools.
Predefined login classes
Juniper documents four predefined classes that cannot be modified. They are useful for testing, but production roles are better served by custom classes, partly because an idle timeout can only be set on a user-defined class.
| Class | Permission flags | Notes |
|---|---|---|
super-user (or superuser) | all | Full control, including shell access; keep to a small, monitored group |
operator | clear, network, reset, trace, view | SFTP and SCP server access disabled for this class |
read-only | view | SFTP and SCP server access disabled for this class |
unauthorized | None | Useful as the class for the remote template when every remote user must be mapped explicitly |
How the authentication order behaves
The authentication-order statement at [edit system] accepts radius, tacplus and password. With no order configured the device uses local passwords only. If SSH public keys are configured for a user, key authentication is tried first.
| Situation | Order without password | Order ending in password |
|---|---|---|
| No AAA server responds | Falls back to local password | Falls back to local password |
| AAA server rejects the user | Access denied | Local password is tried |
| Method unavailable or not configured | Next method in the list | Next method in the list |
The practical consequence: leave password out of the order so that a user the AAA server rejects cannot try a local password, and rely on the always-on fallback when the servers are unreachable. That makes local accounts strictly break-glass, which is what the CISA guidance asks for.
Admin roles and privileged access
- Centralise authentication on TACACS+: add a
tacplus-serverper server with a strongsecret, asource-addresson the loopback and, where management is out of band,routing-instance mgmt_junos. Defaults are TCP 49 and a 3 second timeout. Setauthentication-order tacplus. CISA advises that the AAA service supports MFA and is kept separate from the primary corporate identity store. See the TACACS+ Security guide, or the RADIUS Security Guide where RADIUS is used. - Map roles to custom classes: create classes such as
noc-view,net-changeandnet-admin, and return the matchinglocal-user-namefrom the AAA server. Set theremotetemplate to theunauthorizedclass or a read-only custom class, so a user the server authenticates but does not map gets no change rights. - Scope commands centrally: the Juniper TACACS+ attributes
allow-commands,deny-commands,allow-configurationanddeny-configurationtake extended regular expressions that widen or narrow a class per user. Locally,allow-configuration-exact-matchanddeny-configuration-exact-matchrestrict which hierarchies a class can change. - Control shell access: the
maintenanceflag allows starting a local shell andsu root, and only users with it can view commit, op and event script configuration. Grant it to the fewest people possible. - Protect root and keep one break-glass user: set a long
root-authenticationpassword, keep the SSH defaultroot-login deny-passwordor setroot-login deny, and keep one named local emergency user in a custom class with its password in a vault, changed after each use. See the Break-Glass Account Guide. - Slow password guessing:
[edit system login retry-options]defaults to 3 tries before disconnect, a backoff threshold of 2 and a backoff factor of 5 seconds. Add alockout-period(1 to 43,200 minutes, no default) for local accounts. - Set local password rules:
[edit system login password]setsformat sha512(orsha256), minimum length and character classes. These rules apply to plain-text passwords as they are entered. - Time out idle sessions: set
idle-timeouton every custom class; none is set by default. Users get warnings from five minutes before disconnection. - Work from controlled endpoints: administer from privileged access workstations on the management network. See the Privileged Access Workstations Guide.
Integrations, API tokens and service accounts
Most changes on a large Junos estate come from automation, not people. Each tool is a non-human identity with standing access to the network, and deserves the same rigour as any other service account. See the Service Account Security Guide.
- One identity per tool: configuration backup, monitoring, orchestration and CI pipelines each get their own user and class. Shared automation accounts make accounting records useless and rotation risky.
- SSH keys over passwords: give automation users authorised public keys, keep the private keys in a secrets manager rather than on build servers, and use
no-password-authenticationandno-challenge-responseunder[edit system services ssh]where every login can use keys. See the SSH Key Management Guide. - NETCONF on its own port:
[edit system services netconf ssh]listens on TCP 830 by default. That port accepts only NETCONF sessions, which makes it easy to permit automation hosts to 830 and administrators to 22 in the loopback filter. Juniper notes that port 22 still accepts NETCONF unless a login event script blocks it. - Narrow classes for read-only tools: backup and monitoring tools usually need
viewand file transfer only. Note that the predefinedread-onlyandoperatorclasses have SFTP and SCP disabled, so build a custom read class if the tool pulls files. - Remove clear-text XML access: the SRX factory configuration enables
xnm-clear-textin the trust zone. Juniper's guidance is to remove it withdelete system services xnm-clear-text. - Safe automated changes: NETCONF clients can request a confirmed commit; if it is not confirmed within the timeout (600 seconds by default) the device rolls back to the previous configuration. Use it for every automated change to access control.
- Shared secrets are credentials too: TACACS+, RADIUS and SNMPv3 keys appear in every configuration file and backup. Junos stores the TACACS+ secret encrypted, but backups still need access control, and each key needs an owner and a rotation date. See the Secrets Management Guide.
Logging and detection
Junos records who logged in, what they ran and what they changed, provided the right facilities are sent off the device. CISA's guidance is to send logs over encrypted transport to a store an intruder on the device cannot alter.
| Source | Configuration | What to watch for |
|---|---|---|
Syslog facility authorization | [edit system syslog host ...] | Failed and successful logins, logins as root, logins from unexpected sources, use of the break-glass account |
Syslog facility change-log | Remote host and local file | Commits outside change windows, changes to system login, system services, AAA servers or the loopback filter |
Syslog facility interactive-commands | Remote host and local file | Commands issued by NETCONF and other clients, start shell, file transfers, unusual operational commands |
Syslog facility firewall | Filter terms with syslog | Hits on the discard term of the loopback filter, showing management attempts from outside the allowed sources |
| TACACS+ accounting | [edit system accounting] with events login, change-log, interactive-commands, destination tacplus | Per-user command history held off the device, matched to change tickets |
| Structured syslog | structured-data on syslog files | Machine-parseable messages such as UI_LOGIN_EVENT that are simpler for a SIEM to normalise |
Pair the logs with configuration comparison: pull the running configuration on a schedule, compare it with the approved copy and alert on new local users, new SSH keys, added services or changed AAA settings. See the Network Device Syslog and Configuration Change Detection Guide and the Network Configuration Backup and Change Control guide.
Metrics that show it is working
- Percentage of devices whose only local accounts are
rootand the documented break-glass user. - Percentage of devices with TACACS+ accounting for
interactive-commandsreaching the collector in the last 24 hours. - Number of commits with no matching change record, per month (target zero).
- Percentage of devices answering on Telnet, FTP or HTTP J-Web on any interface (target zero).
- Median age of automation SSH keys and AAA shared secrets against the rotation standard.
Hardening baseline
Management plane services
| Area | Junos setting | Baseline |
|---|---|---|
| SSH protocol | system services ssh protocol-version v2 | v2 is the default; confirm it is not changed |
| Root over SSH | root-login | Default is deny-password; set deny where root never needs SSH |
| SSH algorithms | ciphers, key-exchange, macs | Keep to the default modern sets (CTR, GCM and ChaCha20 ciphers; curve25519 and ECDH key exchange); do not add the CBC ciphers or SHA-1 group exchange that are configurable but off by default |
| SSH limits | connection-limit, rate-limit, client-alive-interval | Defaults are 75 connections and 150 attempts per minute; lower them to match your administrators, and set client-alive values to drop dead sessions |
| SSH forwarding | no-tcp-forwarding | TCP forwarding is allowed by default; turn it off so the device is not a tunnel |
| SFTP server | sftp-server | Off by default from 19.1R1; enable only where tools need it |
| Telnet, FTP, finger | system services telnet, ftp, finger | Remove; use SSH and SCP |
| J-Web | system services web-management | Remove where not used; otherwise HTTPS only with a CA-issued certificate, bound to management interfaces only, HTTP removed |
| SNMP | [edit snmp v3 usm local-engine user] | SNMPv3 with authentication-sha256 and privacy-aes128; the defaults are no authentication and no privacy, so set both. See the SNMP Security Guide |
| Login banner | system login message | Set an authorised-use warning; none is shown by default |
Restrict who can reach the device
- SRX zones first: inbound traffic to an SRX is dropped by default until
host-inbound-traffic system-servicesorprotocolsallows it, at zone or interface level (interface settings override the zone). Allowsshandnetconfonly on the management zone or interface, neverallon an untrust zone. Dedicated management ports can sit in themanagementfunctional zone, whose traffic cannot transit to other interfaces. - Loopback filter on every platform: apply an input filter to
lo0that accepts SSH and NETCONF from the management prefixes, the routing protocols from known peers, and ends in a term that logs and discards everything else. Juniper's documented example,protect-RE, shows this pattern. See the Network Device Management Plane Hardening Guide. - Out-of-band management: use
routing-instance mgmt_junosfor the management interface, AAA and syslog traffic, so management stays off the data plane, as CISA advises. - Change safely: make every access control change with
commit confirmed, then confirm once you have proved you can still log in. A mistake in a loopback filter then rolls itself back.
Rollout plan
- Inventory: pull every configuration and list local users, classes, enabled services, SNMP versions, AAA servers and host-inbound settings.
- Lab and pilot: build the custom classes, TACACS+ mapping and loopback filter on lab devices, then a pilot group of non-critical devices, using confirmed commits.
- Logging before restriction: enable remote syslog and accounting first, so you can see which tools would break when services are removed.
- Remove legacy services and accounts: Telnet, FTP, HTTP J-Web, SNMPv1 and v2c, shared automation users.
- Roll out by region or role: core devices last, with console access confirmed for each site. Roll back with
rollback 1and commit if a problem appears after confirmation. - Keep current: apply Juniper's security updates promptly through the advisories Juniper publishes under its security vulnerability policy, and after each emergency update check for unknown local users and configuration changes. See the Vulnerability Management for Network Devices Guide.
Framework mapping
| Junos control | NIST SP 800-53 Rev. 5 | NIST CSF 2.0 | ATT&CK technique addressed |
|---|---|---|---|
| Custom login classes and AAA command scoping | AC-6 | PR.AA-05 | T1078 Valid Accounts |
| TACACS+ with MFA, break-glass local user | IA-2, IA-5 | PR.AA-05 | T1078.001 Default Accounts |
| Retry options and lockout | IA-5 | PR.AA-05 | T1110 Brute Force |
| Removing unused services, host-inbound rules, loopback filter | CM-7, SC-7, AC-17 | PR.PS-01 | T1602 Data from Configuration Repository |
| Confirmed commits and configuration comparison | CM-3, CM-6 | PR.PS-01 | T1602 Data from Configuration Repository |
| Remote syslog and TACACS+ accounting | AU-2, AU-6, AU-9 | PR.PS-04, DE.CM-09 | T1078 Valid Accounts |
| SSH v2, SNMPv3 privacy, HTTPS J-Web | SC-8 | PR.PS-01 | T1602 Data from Configuration Repository |
| Prompt security updates | SI-2 | PR.PS-01 | All of the above |
Common misconfigurations
passwordleft at the end of the authentication order: a user the TACACS+ server rejects, for example after offboarding, can still log in with an old local password. Leave it out and rely on the unreachable-server fallback.- The
remotetemplate set tosuper-user: every user the AAA server authenticates, mapped or not, gets full control. Set it to a minimal class and map roles explicitly. host-inbound-traffic system-services allon an outside zone: convenient during set-up, it exposes every management service the device runs. Name the services, on the management zone only.- J-Web left enabled on all interfaces: the web interface is useful for SRX administration but should be bound to management interfaces over HTTPS, or removed where the CLI and automation are used.
- Shared automation accounts with password logins: one compromised script host then has every device. Use per-tool users, vaulted SSH keys and TACACS+ accounting.
- Logs kept only on the device: anyone with shell access can remove local files. Forward authorization, change-log and interactive-commands to a remote collector.
Practitioner checklist
- Create custom login classes with idle timeouts; map every AAA role with
local-user-nameand set theremotetemplate to a minimal class. - Configure TACACS+ with MFA on a separate identity store,
authentication-order tacpluswithoutpassword, and accounting for login, change-log and interactive-commands. - Keep only
rootand one vaulted break-glass user locally; setroot-login denyor keepdeny-password. - Set
retry-optionswith a lockout period and SHA-512 password format. - Remove Telnet, FTP, finger, HTTP J-Web and
xnm-clear-text; disable SSH TCP forwarding. - Allow management only through named
host-inbound-trafficservices on SRX and a logginglo0input filter on every device. - Move SNMP to v3 with SHA-256 authentication and AES privacy.
- Give each automation tool its own user, class and vaulted SSH key; use NETCONF on port 830 and confirmed commits.
- Forward syslog off the device, compare configurations with the approved copy and alert on drift.
- Apply Juniper security updates promptly and check for unknown accounts after each emergency update.
Standards and references
- Juniper: Login Classes Overview
- Juniper: Authentication Order
- Juniper: TACACS+ Authentication
- Juniper: Remote Access Overview
- Juniper: Security Zones
- Juniper: Stateless Firewall Filter to Accept Traffic from Trusted Sources
- Juniper: System Logging
- CISA, NSA, FBI and partners: Enhanced Visibility and Hardening Guidance for Communications Infrastructure
Related NHI Mgmt Group resources: Edge Device Security Guide · Network Device Management Plane Hardening Guide · TACACS+ Security · Network Device Syslog and Configuration Change Detection Guide