CCNA 200-301

CCNP Enterprise

CCNP Security

CCIE Enterprise Lab

CCIE Security Lab

CCNP Service Provider

CCNP Data Center

CCNP Collaboration

CCIE DC Lab

Verifying the Secure Shell (SSH) protocol version running on your network infrastructure is a fundamental step in security auditing and compliance. While SSH Version 2 (SSHv2) provides strong encryption and message integrity, legacy configurations on Cisco switches often leave SSH Version 1 (SSHv1) fallback enabled by default, exposing management planes to protocol downgrade and man-in-the-middle attacks. Knowing how to check both the globally configured SSH server version and the protocol version of active user sessions allows administrators to quickly identify and remediate vulnerable switches.

Checking the SSH Version and Active Sessions in Cisco IOS CLI

To determine which SSH protocol version your Cisco Catalyst switch supports—as well as which version active administrators are currently using—follow this step-by-step verification process in the Cisco IOS or IOS-XE command-line interface (CLI).

Step 1: Check the Global SSH Server Version

Log into the switch and enter User EXEC or Privileged EXEC mode. Run the show ip ssh command to inspect the global SSH daemon status:

Switch# show ip ssh
SSH Enabled - version 2.0
Authentication timeout: 120 secs; Authentication retries: 3
Minimum expected Diffie Hellman key size : 1024 bits
IOS Keys in SECSH format(ssh-rsa, base64 encoded): TP-self-signed-1234567890

Look closely at the first line of the output (SSH Enabled - version X.X). This line indicates whether the switch is operating strictly in version 2.0, legacy version 1.5, or compatibility mode 1.99.

Step 2: Check the SSH Version of Active Connections

While show ip ssh reveals what the switch is configured to accept, the show ssh command displays the real-time status and negotiated protocol version of every active SSH session currently connected to the switch:

Switch# show ssh
Connection Version Mode Encryption  Hmac         State                 Username
0          2.0     IN   aes256-ctr  hmac-sha2-256 Session started       netadmin
0          2.0     OUT  aes256-ctr  hmac-sha2-256 Session started       netadmin
%No SSHv1 server connections running.

Review the Version column for each active VTY connection alongside the summary line at the bottom (%No SSHv1 server connections running.) to confirm no legacy clients are connected.

Step 3: Verify the Running Configuration Explicitly

If you have Privileged EXEC access and want to verify whether a specific version has been hardcoded into the configuration file, filter the running configuration:

Switch# show running-config | include ip ssh version
ip ssh version 2

If this command returns an empty output even though SSH is enabled, the switch is running in its default unforced compatibility state. Key Takeaway: Always pair show ip ssh with show ssh so you can verify both the switch’s global capability and the actual encryption parameters negotiated by connected clients.


Decoding the Output: What Does SSH Version 1.99 Mean?

When reviewing the output from the verification steps above, administrators frequently encounter version numbers that do not appear to match standard SSHv1 or SSHv2 labels. The following frequently asked questions clarify what those values signify for your switch’s security posture.

What does “SSH Enabled – version 1.99” mean on a Cisco switch?

As defined in RFC 4253, version 1.99 is not a standalone protocol revision. Instead, it is an internal backward-compatibility banner identifier used by the SSH server to announce that it accepts both SSHv1 (specifically protocol 1.5) and SSHv2 (protocol 2.0) connections. When a client initiates a handshake with a switch displaying 1.99, the switch negotiates whichever version the client requests.

What is the difference between SSH 1.99 and SSH 2.0 on Cisco IOS?

A switch reporting version 1.99 operates in dual-mode, permitting connections from legacy SSHv1 clients as well as modern SSHv2 clients. A switch reporting version 2.0 has been explicitly restricted to SSHv2 only and will immediately reject any connection attempt using the SSHv1 protocol.

Is SSH version 1.99 secure on a Cisco switch?

No. Even if your administrators exclusively use modern SSHv2 client software, leaving a switch in 1.99 mode is considered a security vulnerability and fails compliance frameworks such as PCI-DSS, NIST, and CIS Benchmarks. Because SSHv1 remains active on the listening daemon, an attacker on the network path can execute a protocol downgrade attack, forcing a session negotiation down to SSHv1 to exploit its weak cyclic redundancy check (CRC-32) integrity flaws and weak key exchange mechanisms.

What if the output says “SSH Disabled – version 1.99”?

This output indicates that the switch OS supports both SSHv1 and SSHv2 by default, but the SSH server process itself is currently inactive because an RSA cryptographic key pair has not yet been generated on the device. Key Takeaway: Treat version 1.99 as an active SSHv1 vulnerability rather than an incremental update close to version 2.0.


Cisco IOS SSH Command Reference and Field Definitions

Understanding the exact syntax, historical support, and output metrics of the SSH verification commands helps ensure consistent auditing across older Cisco IOS and newer IOS-XE releases.

show ip ssh

Displays the operational version and global configuration parameters of the SSH server.

  • Syntax: show ip ssh
  • Command Mode: User EXEC (>) or Privileged EXEC (#)
  • Release History: Introduced in Cisco IOS Release 12.1(3)T; enhanced in 12.3(4)T to display version 2.0 support and in 15.5(2)T to display minimum Diffie-Hellman key sizes.
Output FieldOfficial Description
SSH Enabled / Disabled - versionIndicates whether the SSH daemon is actively listening for connections and reports the supported protocol version (1.5, 1.99, or 2.0).
Authentication timeoutMaximum duration (in seconds) the SSH server waits for a client to complete user authentication before terminating the TCP session. Default is 120 seconds.
Authentication retriesNumber of consecutive failed login attempts permitted before the connection is dropped. Default is 3 retries.
Minimum expected Diffie Hellman key sizeMinimum modulus length (in bits) required during the Diffie-Hellman group key exchange.
IOS Keys in SECSH formatDisplays the public RSA host key configured for the SSH server in IETF SECSH base64-encoded format.

ip ssh version

Restricts the SSH server on the switch to run a specific protocol version.

  • Syntax: ip ssh version [1 | 2] / no ip ssh version
  • Command Mode: Global Configuration (config#)
  • Release History: Introduced in Cisco IOS Release 12.3(4)T and 12.2(25)S. In recent Cisco IOS-XE releases (such as 17.x), version 2 is preferred by default and version 1 is deprecated.

Key Takeaway: Reference the authentication timeout, retry counters, and Diffie-Hellman bit size alongside the protocol version in show ip ssh to verify complete management-plane compliance.


Checking SSH Versions on Cisco Catalyst (IOS/IOS-XE) vs. Cisco Nexus (NX-OS)

While the commands covered above apply to Cisco Catalyst switches running IOS or IOS-XE, Cisco Nexus data center switches run NX-OS, which uses a modular feature architecture and different CLI syntax. If you manage a mixed environment, use the comparison table below to translate SSH verification tasks between platforms.

Verification or Management TaskCisco Catalyst (IOS / IOS-XE)Cisco Nexus (NX-OS)
Check SSH Server Status & Versionshow ip sshshow ssh server
View Active SSH Client Sessionsshow sshshow ssh session (or show users)
Verify Configured Host Keysshow crypto key mypubkey rsashow ssh key
Check Running Configuration for SSHshow running-config \| include sshshow running-config \| include ssh
Default Protocol BehaviorDefaults to 1.99 (v1 and v2) on legacy IOS; 2.0 on modern IOS-XENative v2 only (ssh version v2 is enabled)
Enable the SSH ServiceAutomatically enabled upon generating RSA keysExplicitly enabled via feature ssh in config mode

Key Takeaway: On Cisco Nexus switches, use show ssh server instead of show ip ssh, and note that NX-OS natively enforces SSHv2 without using a 1.99 compatibility state.


How to Enable SSH Version 2 and Disable SSHv1

If your audit on a Cisco Catalyst switch reveals that it is running in 1.99 or 1.5 mode, you should immediately restrict the device to accept only SSHv2 connections. Follow these sequential steps to harden the switch without dropping your active management session.

Step 1: Verify the RSA Key Modulus Size

SSHv2 requires an RSA host key with a minimum modulus length of 768 bits, though modern security standards require at least 2048 bits. Check your existing key size before enforcing SSHv2:

Switch# show crypto key mypubkey rsa

If the key modulus is smaller than 2048 bits (or missing), enter global configuration mode, ensure a hostname and domain name are set, and generate a 2048-bit RSA key pair:

Switch# configure terminal
Switch(config)# ip domain-name example.com
Switch(config)# crypto key generate rsa modulus 2048

Step 2: Enforce SSH Version 2 Only

In global configuration mode, instruct the switch to disable SSHv1 support and exclusively run SSHv2:

Switch(config)# ip ssh version 2

(Note: Modifying the SSH version does not disconnect your current SSHv2 management session.)

Step 3: Restrict VTY Lines to SSH Only

To ensure administrators cannot bypass SSHv2 by falling back to unencrypted Telnet, verify that your Virtual Teletype (VTY) lines only allow SSH inbound traffic:

Switch(config)# line vty 0 15
Switch(config-line)# transport input ssh
Switch(config-line)# end

Step 4: Verify and Save the Configuration

Run show ip ssh as covered earlier to confirm the first line now strictly reads SSH Enabled - version 2.0, and then save your configuration to NVRAM:

Switch# copy running-config startup-config

Key Takeaway: Enforcing SSHv2 requires a single command (ip ssh version 2), provided the underlying RSA key pair meets the minimum bit-length requirement.


Automating SSH Version Audits Across Multiple Cisco Switches

Logging into switches one by one is impractical across large enterprise networks. You can use the following Python (Netmiko) script or Ansible playbook template to bulk-audit your Cisco IOS fleet and flag any devices not strictly enforcing version 2.0.

Option 1: Python Netmiko Audit Script

import re
from netmiko import ConnectHandler

switches = [
    {"device_type": "cisco_ios", "host": "10.10.1.10", "username": "admin", "password": "Password123"},
    {"device_type": "cisco_ios", "host": "10.10.1.11", "username": "admin", "password": "Password123"},
]

version_pattern = re.compile(r"SSH\s+(Enabled|Disabled)\s+-\s+version\s+(\S+)")

print(f"{'Switch Host':<15} | {'Status':<10} | {'Version':<8} | {'Compliance'}")
print("-" * 52)

for device in switches:
    host = device["host"]
    try:
        with ConnectHandler(**device) as net_connect:
            output = net_connect.send_command("show ip ssh")
            match = version_pattern.search(output)
            if match:
                status, version = match.group(1), match.group(2)
                compliant = "PASS" if (status == "Enabled" and version == "2.0") else "FAIL (Remediate)"
                print(f"{host:<15} | {status:<10} | {version:<8} | {compliant}")
            else:
                print(f"{host:<15} | {'Unknown':<10} | {'N/A':<8} | FAIL (Parse Error)")
    except Exception as err:
        print(f"{host:<15} | {'Unreachable':<10} | {'N/A':<8} | ERROR: {str(err).splitlines()[0]}")

Option 2: Ansible Compliance Playbook (audit_ssh_version.yml)

---
- name: Audit SSH Version on Cisco IOS Switches
  hosts: cisco_switches
  gather_facts: no
  connection: network_cli

  tasks:
    - name: Run show ip ssh on target switches
      cisco.ios.ios_command:
        commands:
          - show ip ssh
      register: ssh_output

    - name: Assert that SSH Version 2.0 is strictly enabled
      ansible.builtin.assert:
        that:
          - "'SSH Enabled - version 2.0' in ssh_output.stdout[0]"
        success_msg: "{{ inventory_hostname }} is compliant (SSHv2 strictly enabled)."
        fail_msg: "{{ inventory_hostname }} is NON-COMPLIANT! Current state: {{ ssh_output.stdout_lines[0][0] }}"
      ignore_errors: yes

Key Takeaway: Integrating automated checks against the SSH Enabled - version 2.0 string into your scheduled compliance pipelines prevents configuration drift and immediately highlights legacy switches requiring remediation.


Regularly checking the SSH version across your Cisco switching environment is a quick, high-impact security practice. Whether you are inspecting a single Catalyst switch with show ip ssh and show ssh, checking a Nexus switch with show ssh server, or auditing hundreds of devices via automation, verifying that every switch reports version 2.0 rather than 1.99 ensures your network management plane stays protected against legacy protocol vulnerabilities.

Please follow and like us:
Last modified: November 18, 2026

Author

Comments

Write a Reply or Comment

Your email address will not be published.