Use it as the standard way to manage routers and switches, and when SSH logins fail or Telnet must be replaced.
SSH
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.
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.
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
hostname <hostname>Primary Commands
Configuration and operational commands for this Topic.
hostname <hostname>ReferenceSet the device hostname, required before generating RSA keys for SSH.
Use when: Use this command at the Device Management / SSH / Management Plane boundary in the documented evidence chain.
Quick note: Cisco IOS / IOS XE first. A listening SSH service does not prove VTY ACL, AAA, authorization, return routing or safe recovery.
Cisco IOS / IOS XE · mixedip domain-name <domain>ReferenceSet the domain name, required before generating RSA keys for SSH.
Use when: Use this command at the Device Management / SSH / Management Plane boundary in the documented evidence chain.
Quick note: Cisco IOS / IOS XE first. A listening SSH service does not prove VTY ACL, AAA, authorization, return routing or safe recovery.
Cisco IOS / IOS XE · mixedusername <user> secret <password>ReferenceCreate a local user with a hashed secret (used for SSH logins).
Use when: Use this command at the Device Management / SSH / Management Plane boundary in the documented evidence chain.
Quick note: Cisco IOS / IOS XE first. A listening SSH service does not prove VTY ACL, AAA, authorization, return routing or safe recovery.
Cisco IOS / IOS XE · mixedcrypto key generate rsa modulus 2048ReferenceGenerate an RSA key pair, required before SSH can be enabled; use 2048 bits or more.
Use when: Use this command at the Device Management / SSH / Management Plane boundary in the documented evidence chain.
Quick note: Cisco IOS / IOS XE first. A listening SSH service does not prove VTY ACL, AAA, authorization, return routing or safe recovery.
Cisco IOS / IOS XE · mixedip ssh version 2ReferenceAllow only SSH version 2.
Use when: Use this command at the Device Management / SSH / Management Plane boundary in the documented evidence chain.
Quick note: Cisco IOS / IOS XE first. A listening SSH service does not prove VTY ACL, AAA, authorization, return routing or safe recovery.
Cisco IOS / IOS XE · mixedline vty 0 15ReferenceEnter configuration for VTY lines 0–15 (remote management sessions).
Use when: Use this command at the Device Management / SSH / Management Plane boundary in the documented evidence chain.
Quick note: Cisco IOS / IOS XE first. A listening SSH service does not prove VTY ACL, AAA, authorization, return routing or safe recovery.
Cisco IOS / IOS XE · mixedlogin localReferenceAuthenticate line logins against local usernames.
Use when: Use this command at the Device Management / SSH / Management Plane boundary in the documented evidence chain.
Quick note: Cisco IOS / IOS XE first. A listening SSH service does not prove VTY ACL, AAA, authorization, return routing or safe recovery.
Cisco IOS / IOS XE · mixedtransport input sshReferenceAllow only SSH on the lines.
Use when: Use this command at the Device Management / SSH / Management Plane boundary in the documented evidence chain.
Quick note: Cisco IOS / IOS XE first. A listening SSH service does not prove VTY ACL, AAA, authorization, return routing or safe recovery.
Cisco IOS / IOS XE · mixedexec-timeout <minutes> <seconds>ReferenceDisconnect idle line sessions after the given time.
Use when: Use this command at the Device Management / SSH / Management Plane boundary in the documented evidence chain.
Quick note: Cisco IOS / IOS XE first. A listening SSH service does not prove VTY ACL, AAA, authorization, return routing or safe recovery.
Cisco IOS / IOS XE · mixedShow Commands
Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.
show sshShowDisplay active SSH sessions.
Use when: Use this command at the Device Management / SSH / Management Plane boundary in the documented evidence chain.
Quick note: Cisco IOS / IOS XE first. A listening SSH service does not prove VTY ACL, AAA, authorization, return routing or safe recovery.
Cisco IOS / IOS XE · mixedshow ip sshShowDisplay SSH version and settings.
Use when: Use this command at the Device Management / SSH / Management Plane boundary in the documented evidence chain.
Quick note: Cisco IOS / IOS XE first. A listening SSH service does not prove VTY ACL, AAA, authorization, return routing or safe recovery.
Cisco IOS / IOS XE · mixedVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
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.
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.
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
Official Sources
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
| Measure | Reason |
|---|---|
| Version 2 only | SSHv1 is insecure |
| Keys of 2048 bits or more | Strong host key |
| VTY access class | Only management networks |
| AAA with individual accounts | Accountability |
| Public-key authentication for admins and automation | No password guessing |
| Modern algorithms only | Disable weak ciphers, MACs and key exchanges where the platform allows |
| Exec timeout | Idle 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
| Symptom | Check |
|---|---|
| Connection refused | transport input, SSH enabled, RSA key exists |
| Connection resets | Access class, VTY lines exhausted |
| Key exchange fails | Client and device algorithm mismatch; update software rather than weakening the client |
Documented example, not captured output.
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.
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
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
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%Quick lookup tables
SSH · technical reference
Compact network access/security mechanics, policy and evidence boundaries for fast lookup.
| Stage | What it proves |
|---|---|
| TCP open | Transport path reaches SSH listener |
| SSH handshake | Encrypted protocol established |
| Authentication | User identity accepted |
| Authorization | Intended privilege/actions allowed |
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.