Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

SSH

Direct answer

SSH (Secure Shell) version 2 gives encrypted, authenticated CLI access to a device. On Cisco IOS it needs a hostname, a domain name, an RSA key pair and transport input ssh on the VTY lines.

When to use this

Use it as the standard way to manage routers and switches, and when SSH logins fail or Telnet must be replaced.

First 30 seconds

1. show ip ssh — "SSH Enabled - version 2.0"? If disabled → no RSA key: crypto key generate rsa modulus 2048.

2. show running-config | section line vty — transport input ssh on all ranges (0 4 and 5 15)?

3. VTY access-class permits your source?

4. Login method: AAA server reachable, or local account present?

5. Log in from a second session before closing the working one.

Operational verification

hostname and domain set → RSA key generated → SSH v2 enabled → VTY lines allow SSH from permitted sources → user authenticated (AAA/local) → session logged

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Cisco IOS / IOS XE
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCisco IOS / IOS XE
Key commandhostname <hostname>
Scope / prerequisiteUse it as the standard way to manage routers and switches, and when SSH logins fail or Telnet must be replaced.
Show · 2Reference · 9
What next?3 suggested next steps
Catalog command links11
Evidence0
On this pageJump to a specific section
Cisco IOS / IOS XE first

Primary Commands

Configuration and operational commands for this Topic.

Verification

Show Commands

Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

6 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Read-only Verification Verify boundary
show ip ssh
show ssh
show users
show running-config | section line vty
show logging

Inspect server version, negotiated sessions, logged-in lines, every VTY range and relevant authentication logs. Redact usernames, addresses and sensitive configuration before sharing. Correlate timestamps and source addresses with one bounded login attempt.

Step 2 SSH: bounded access test and key recovery limits Verify boundary

In an isolated or approved administrative test, keep independent console recovery and a known-good session. From the permitted management source, validate host identity, establish a new SSHv2 session and run only the intended allowed commands. Test one denied source and one restricted account/action within scope; correlate the policy outcome, not just connection failure.

For a planned key rotation, record the trusted old/new public fingerprint through the authorized process and assess all services using the key. A normal running-config backup is not a guarantee that the prior private key can be restored. Do not delete or regenerate production keys merely to execute this reference. Restore the exact prior line/ACL/AAA binding when a scoped access-policy test ends and verify new connections before closing recovery access.

Examples and expected outcomes are authored documentation; no device login, key rotation or new Evidence was performed.

Step 3 Verification and output interpretation Verify boundary

Verify from an authorized management source and distinguish TCP connection, SSH negotiation, host-key verification, user authentication, EXEC authorization and privilege. On the device, inspect SSH session/server state and VTY usage; on the AAA server, correlate the username/device/timestamp where remote authentication is used. A successful SSH handshake shows encrypted transport establishment, not that the user will authenticate or receive intended authorization. Verify the complete management path from a representative authorized source: routing to the management address, permitted transport, negotiated secure protocol, identity result, privilege/authorization and command/session behavior. Device-side session/service state should be correlated with AAA/server logs where remote identity is used. A TCP connection to port 22 or an SSH banner only shows part of the path, but it does not show credential acceptance, authorization, correct privilege or the availability of a safe recovery method.

Step 4 Failure Signatures Narrow the fault
  • Connection timeout/refusal: inspect routing, listener availability, source ACL and VTY capacity.
  • No matching key exchange, cipher or host-key algorithm: compare both peers and release support.
  • Host-key warning: validate the new fingerprint out of band; do not delete trust blindly.
  • Authentication rejected: inspect identity and the selected local/AAA method.
  • Login succeeds but EXEC/commands fail: inspect authorization separately.
  • Works outside management VRF only: inspect VRF return route and VTY ACL semantics.

For Telnet migration, establish and validate a second SSH session with intended authorization from an allowed source; retain console recovery, then restrict all VTY ranges to SSH and confirm Telnet is denied. Save only after validating the changed access path.

Step 5 SSH: transport, host identity and permission branches Narrow the fault

If connection fails, separate management route/source filtering from SSH negotiation and authentication. If negotiation fails, inspect supported protocol/algorithm and key-size policy for the deployed release rather than enabling obsolete algorithms blindly. If the client reports a changed host key, validate the expected device/key change through an independent trusted path before updating trust.

If authentication succeeds but commands fail, inspect EXEC/command authorization and actual privilege; do not regenerate the host key. Compare all applicable VTY ranges and any existing named AAA list. Use sanitized logs with the same client/time window. A denied management source and an unauthorized user are different tests.

Login attempts generate traffic and can affect lockout counters. Start with passive observations and preserve independent console/recovery access before a bounded test or configuration change.

Step 6 Verification & troubleshooting Narrow the fault

1. Verify management interface/VRF and return route.

2. Verify SSH keys/version and VTY transport.

3. Verify ACL and AAA method list.

4. Test from an allowed source in a second session.

5. Confirm logs and recovery access.

Command lookup Jump straight to Cisco syntax
Key points

Setup: hostname, ip domain name, crypto key generate rsa modulus 2048 (or larger), ip ssh version 2, line vty 0 15 + transport input ssh + login local or AAA, plus a VTY access-class. SSH failing after a hostname or domain change usually means the key is missing. Clients warn when the host key changes — check before accepting.

Key checks
  • show ip ssh — SSH enabled, version 2, timeout and retries.
  • show ssh — active SSH sessions with version and cipher.
  • show crypto key mypubkey rsa — the RSA key used by SSH.
  • show running-config | section line vty — transport input, access-class and login method on every VTY range.
  • show users — logged-in users and their source address.
ReferenceWhat it is2 sections · depth on demand

Direct Answer

Use SSHv2 for encrypted CLI management. A successful SSH handshake proves neither user authorization nor correct management-source policy.

What it is

The management plane terminates administrative protocols and must be isolated, authenticated, encrypted, logged and recoverable.

Path: Networking → Security → SSH.

ReferenceHow it works2 sections · depth on demand

Technical Mechanics

SSH separates transport protection, server host identity, user authentication and session channels. Pin or independently validate the server host-key fingerprint; an unexpected change needs investigation before accepting it. Host-key authentication and user public-key authentication solve different trust questions.

On IOS / IOS XE, usable server keys and VTY access are prerequisites. Local login and AAA method lists are alternative authentication designs; follow AAA for centralized authorization/accounting. Do not enable AAA blindly on an existing device. A fallback method is not a bypass for an explicit server rejection.

Algorithm availability changes by image/release. Compare the client negotiation failure with the device-supported algorithms and Cisco release documentation. Prefer a supported software upgrade to globally weakening clients. Regenerating host keys changes client trust and can disrupt access.

SSH: observe before generating or replacing keys

Scope: Cisco IOS / IOS XE SSHv2 administrative access. crypto key generate rsa modulus 2048 generates key material; it is not a read-only observation. Replaying a setup example can change the server identity or affect dependent services, depending on key selection and existing configuration.

Read show ip ssh, show ssh, show users and the relevant VTY/AAA configuration. Record listener/version, selected host-key policy, source restrictions, line range and intended login service without publishing private keys, secrets or sensitive identities. A reachable TCP/22 listener is not evidence of user authorization or trusted host identity.

Preserve the existing Cisco Configuration and Read-only Verification sections in this Topic: setup commands and status commands have different purposes. Reference: Cisco SSH configuration.

ReferenceImportant terms & boundaries7 sections · depth on demand

Key operational limits

  • SSHv2 protects the session; VTY policy still controls who may connect and how users authenticate
  • Use a dedicated management VRF/interface where supported and restrict sources with ACL/firewall policy
  • Disable Telnet and unused HTTP services
  • Prefer named administrators, AAA, least privilege, timeouts and audit logging
  • Preserve an out-of-band recovery path before changing remote access.

Proof Boundaries

Configuration presence, a listener and a login are separate observations. Test an allowed management source and a denied source with authorization to perform those checks. Verify the intended privilege and required read-only commands. No live router, packet capture, AAA server response or device output was collected for this reference.

In depth

SSH for device management

SSH is the standard secure CLI path to network devices. Cisco's IOS hardening guide recommends SSH instead of Telnet, enforcing version 2 with ip ssh version 2 after generating RSA keys (crypto key generate rsa modulus 2048), restricting VTY lines to transport input ssh, and using SCP for file transfer (ip scp server enable).

R1(config)# hostname R1
R1(config)# ip domain name example.net
R1(config)# crypto key generate rsa modulus 2048 label SSH-KEY
R1(config)# ip ssh version 2
R1(config)# ip ssh rsa keypair-name SSH-KEY
R1(config)# ip ssh time-out 60
R1(config)# ip ssh authentication-retries 3
R1(config)# ip ssh source-interface Loopback0
R1(config)# line vty 0 15
R1(config-line)# transport input ssh
R1(config-line)# access-class MGMT-HOSTS in vrf-also
R1(config-line)# exec-timeout 10 0
R1(config)# ip scp server enable
R1# show ip ssh
SSH Enabled - version 2.0
Authentication methods:publickey,keyboard-interactive,password
R1# show ssh
admin$ ssh -o KexAlgorithms=+diffie-hellman-group14-sha256 netadmin@10.255.0.1

Hardening SSH

MeasureReason
Version 2 onlySSHv1 is insecure
Keys of 2048 bits or moreStrong host key
VTY access classOnly management networks
AAA with individual accountsAccountability
Public-key authentication for admins and automationNo password guessing
Modern algorithms onlyDisable weak ciphers, MACs and key exchanges where the platform allows
Exec timeoutIdle sessions closed

SSH and automation

Automation tools (Ansible, Netmiko, NETCONF over SSH on port 830) use SSH too. Give them their own accounts with appropriate privilege, and store keys in a vault.

Troubleshooting

SymptomCheck
Connection refusedtransport input, SSH enabled, RSA key exists
Connection resetsAccess class, VTY lines exhausted
Key exchange failsClient and device algorithm mismatch; update software rather than weakening the client

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Quick reference

SSH provides encrypted remote CLI access to network devices. It needs a hostname, domain name and RSA/ECDSA key, SSH version 2, and VTY lines restricted to SSH.

hostname sw01
ip domain name corp.example.com
crypto key generate rsa modulus 3072
ip ssh version 2
line vty 0 15
 transport input ssh
 login authentication VTY
 access-class MGMT-ONLY in

Documented example, not captured output.

Verify with show ip ssh and show ssh; disable weak algorithms where the platform allows.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

State model and technical mechanics

SSH starts with TCP reachability and protocol negotiation, then establishes cryptographic algorithms/session keys, validates server host identity from the client perspective and performs user authentication. Only after those stages does an EXEC/CLI session exist, where AAA authorization may further restrict privilege or commands. Host keys and user credentials serve different purposes: the device host key identifies the server endpoint, while user authentication identifies the administrator. A VTY transport policy can allow SSH while AAA or an access-class still denies the session. Management-plane security protects how administrators reach and control the device. The effective path includes the listening service, transport protection, identity source, VTY/line selection, AAA policy, privilege/authorization and any management ACL or VRF. Each layer can be healthy while another blocks access. Cryptographic transport protects confidentiality/integrity in transit, while authentication and authorization decide who may connect and what they may do after connection; those are related but distinct controls.

Limits and common misconceptions

SSH confidentiality does not make the management plane safe by itself. Weak credentials, overly broad source reachability, incorrect AAA fallback or excessive privilege can remain. Failure before a banner is different from authentication rejection after transport is established. Also separate server host-key warnings from user-credential failures. Treat transport security, endpoint identity, user identity, authorization and source restriction as independent layers. Management security is not equivalent to data-plane security. An SSH service can be hardened while transit traffic remains exposed, and a correctly applied management ACL can block an administrator without indicating a routing failure. Disabling Telnet or HTTP is useful hygiene but is not a complete hardening model. Separate service exposure, crypto, identity, authorization, source restriction and recovery access as evidence layers. Preserve enough context for ChatGPT to reason about a live access issue without embedding an interactive remediation tree in Pcornel.

ReferenceConfiguration & state2 sections · depth on demand

Cisco Configuration

State-changing example: local authentication on a device without AAA, default VRF, RSA 2048-bit host key. Replace the example credential before use. Confirm platform key-size policy, all VTY ranges and an independent console recovery path. Do not regenerate an existing production key merely to replay this example.

hostname R1
ip domain-name example.net
username netops secret REPLACE_WITH_UNIQUE_SECRET
crypto key generate rsa modulus 2048
ip ssh version 2
ip ssh time-out 60
ip ssh authentication-retries 3
line vty 0 4
 login local
 transport input ssh
 exec-timeout 10 0

Apply equivalent policy to every additional VTY range present on the device. ip ssh time-out bounds authentication negotiation; exec-timeout bounds idle EXEC sessions. For an existing AAA deployment, bind the reviewed named login method list with login authentication <list-name> instead of copying login local; validate EXEC/command authorization separately.

Management ACL / VTY Protection owns the source ACL example. For management-VRF access, validate ingress interface membership, return routing and the release-specific VTY ACL behavior. access-class 10 in vrf-also permits the ACL to apply to VRF-arriving sessions; it does not create a management VRF or restrict access to one named VRF.

Design and configuration model

Use SSH version 2 behavior, generate appropriate host keys, define the device identity/domain requirements used by key generation, and restrict VTY transport to secure methods. Couple SSH with AAA and a management ACL/VRF where appropriate. Key size/algorithm choices should follow the platform's supported secure baseline; avoid documenting live private keys or secrets. Keep VTY line ranges consistent so an administrator does not land on a line with different transport or AAA policy. Prefer encrypted management protocols, limit reachable management interfaces, restrict source networks with explicit policy, and integrate AAA without removing a validated recovery path. Device-hardening changes should be staged so disabling legacy services does not also remove the only available access mechanism. Keep keys, local secrets and AAA server configuration out of shared examples. Management source interfaces/VRFs should be stable and documented because they influence return routing, ACL matching and AAA server policy.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCisco IOS / IOS XE Current documentation reviewed 2026-09-14

Authoritative/upstream documentation reviewed for bounded claims in Security → SSH. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%
Embedded reference data

Quick lookup tables

SSH · technical reference

Compact network access/security mechanics, policy and evidence boundaries for fast lookup.

StageWhat it proves
TCP openTransport path reaches SSH listener
SSH handshakeEncrypted protocol established
AuthenticationUser identity accepted
AuthorizationIntended privilege/actions allowed
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Expected Output

Illustrative output — authored example, not a device capture:

SSH Enabled - version 2.0
Authentication timeout: 60 secs; Authentication retries: 3

An empty show ssh result can mean no current sessions. An enabled server does not prove that the intended user or source can log in.

Confirmation

Confirm action

Continue?