Join our Newsletter — 33% off our NHI Course
Home› Guides› Juniper Junos and SRX Hardening Guide: Login Classes,…
Guide Network Security

Juniper Junos and SRX Hardening Guide: Login Classes, AAA, Services and Logging

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 14 November 2026 15 min read
On this page

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 password is 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-traffic allows 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 user has a name, UID and a class. The root account 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 Juniper local-user-name attribute for TACACS+ or Juniper-Local-User-Name for 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.

ClassPermission flagsNotes
super-user (or superuser)allFull control, including shell access; keep to a small, monitored group
operatorclear, network, reset, trace, viewSFTP and SCP server access disabled for this class
read-onlyviewSFTP and SCP server access disabled for this class
unauthorizedNoneUseful 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.

SituationOrder without passwordOrder ending in password
No AAA server respondsFalls back to local passwordFalls back to local password
AAA server rejects the userAccess deniedLocal password is tried
Method unavailable or not configuredNext method in the listNext 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

  1. Centralise authentication on TACACS+: add a tacplus-server per server with a strong secret, a source-address on the loopback and, where management is out of band, routing-instance mgmt_junos. Defaults are TCP 49 and a 3 second timeout. Set authentication-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.
  2. Map roles to custom classes: create classes such as noc-view, net-change and net-admin, and return the matching local-user-name from the AAA server. Set the remote template to the unauthorized class or a read-only custom class, so a user the server authenticates but does not map gets no change rights.
  3. Scope commands centrally: the Juniper TACACS+ attributes allow-commands, deny-commands, allow-configuration and deny-configuration take extended regular expressions that widen or narrow a class per user. Locally, allow-configuration-exact-match and deny-configuration-exact-match restrict which hierarchies a class can change.
  4. Control shell access: the maintenance flag allows starting a local shell and su root, and only users with it can view commit, op and event script configuration. Grant it to the fewest people possible.
  5. Protect root and keep one break-glass user: set a long root-authentication password, keep the SSH default root-login deny-password or set root-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.
  6. 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 a lockout-period (1 to 43,200 minutes, no default) for local accounts.
  7. Set local password rules: [edit system login password] sets format sha512 (or sha256), minimum length and character classes. These rules apply to plain-text passwords as they are entered.
  8. Time out idle sessions: set idle-timeout on every custom class; none is set by default. Users get warnings from five minutes before disconnection.
  9. 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-authentication and no-challenge-response under [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 view and file transfer only. Note that the predefined read-only and operator classes 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-text in the trust zone. Juniper's guidance is to remove it with delete 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.

SourceConfigurationWhat 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-logRemote host and local fileCommits outside change windows, changes to system login, system services, AAA servers or the loopback filter
Syslog facility interactive-commandsRemote host and local fileCommands issued by NETCONF and other clients, start shell, file transfers, unusual operational commands
Syslog facility firewallFilter terms with syslogHits 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 tacplusPer-user command history held off the device, matched to change tickets
Structured syslogstructured-data on syslog filesMachine-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 root and the documented break-glass user.
  • Percentage of devices with TACACS+ accounting for interactive-commands reaching 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

AreaJunos settingBaseline
SSH protocolsystem services ssh protocol-version v2v2 is the default; confirm it is not changed
Root over SSHroot-loginDefault is deny-password; set deny where root never needs SSH
SSH algorithmsciphers, key-exchange, macsKeep 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 limitsconnection-limit, rate-limit, client-alive-intervalDefaults are 75 connections and 150 attempts per minute; lower them to match your administrators, and set client-alive values to drop dead sessions
SSH forwardingno-tcp-forwardingTCP forwarding is allowed by default; turn it off so the device is not a tunnel
SFTP serversftp-serverOff by default from 19.1R1; enable only where tools need it
Telnet, FTP, fingersystem services telnet, ftp, fingerRemove; use SSH and SCP
J-Websystem services web-managementRemove 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 bannersystem login messageSet an authorised-use warning; none is shown by default

Restrict who can reach the device

  1. SRX zones first: inbound traffic to an SRX is dropped by default until host-inbound-traffic system-services or protocols allows it, at zone or interface level (interface settings override the zone). Allow ssh and netconf only on the management zone or interface, never all on an untrust zone. Dedicated management ports can sit in the management functional zone, whose traffic cannot transit to other interfaces.
  2. Loopback filter on every platform: apply an input filter to lo0 that 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.
  3. Out-of-band management: use routing-instance mgmt_junos for the management interface, AAA and syslog traffic, so management stays off the data plane, as CISA advises.
  4. 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

  1. Inventory: pull every configuration and list local users, classes, enabled services, SNMP versions, AAA servers and host-inbound settings.
  2. 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.
  3. Logging before restriction: enable remote syslog and accounting first, so you can see which tools would break when services are removed.
  4. Remove legacy services and accounts: Telnet, FTP, HTTP J-Web, SNMPv1 and v2c, shared automation users.
  5. Roll out by region or role: core devices last, with console access confirmed for each site. Roll back with rollback 1 and commit if a problem appears after confirmation.
  6. 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 controlNIST SP 800-53 Rev. 5NIST CSF 2.0ATT&CK technique addressed
Custom login classes and AAA command scopingAC-6PR.AA-05T1078 Valid Accounts
TACACS+ with MFA, break-glass local userIA-2, IA-5PR.AA-05T1078.001 Default Accounts
Retry options and lockoutIA-5PR.AA-05T1110 Brute Force
Removing unused services, host-inbound rules, loopback filterCM-7, SC-7, AC-17PR.PS-01T1602 Data from Configuration Repository
Confirmed commits and configuration comparisonCM-3, CM-6PR.PS-01T1602 Data from Configuration Repository
Remote syslog and TACACS+ accountingAU-2, AU-6, AU-9PR.PS-04, DE.CM-09T1078 Valid Accounts
SSH v2, SNMPv3 privacy, HTTPS J-WebSC-8PR.PS-01T1602 Data from Configuration Repository
Prompt security updatesSI-2PR.PS-01All of the above

Common misconfigurations

  • password left 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 remote template set to super-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 all on 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-name and set the remote template to a minimal class.
  • Configure TACACS+ with MFA on a separate identity store, authentication-order tacplus without password, and accounting for login, change-log and interactive-commands.
  • Keep only root and one vaulted break-glass user locally; set root-login deny or keep deny-password.
  • Set retry-options with 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-traffic services on SRX and a logging lo0 input 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

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

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 14 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.