Cisco Switch SSH Connection Refused or Timeout? C9200/C9300 Troubleshooting Guide

Follow Us:
Quick Take
Connection refused and SSH timeout usually indicate different problems. A refused connection often means that the management IP is reachable but the switch is not accepting SSH on TCP port 22. A timeout usually points to a management-path problem involving the VLAN, route, VRF, ACL, firewall, or interface state.

If SSH fails on a Cisco Catalyst 9200, 9200L, 9300, 9300L, or 9500, start with the exact error message rather than changing the entire configuration. The fastest troubleshooting path is to check management reachability, SSH service status, RSA keys, VTY settings, authentication, and access restrictions in that order.

This guide focuses on SSH failures after configuration, an IOS XE upgrade, or a management-network change. It does not replace a basic Cisco SSH setup guide, and Catalyst 1300 switches should not be diagnosed with the same IOS XE command sequence.

1. Start With the Error Message
2. Confirm the Management Path
3. Check the SSH Service and RSA Keys
4. Verify VTY and Authentication Settings
5. Troubleshoot SSH After an IOS XE Upgrade
6. Catalyst 9200, 9300, 9500, and C1300 Scope
7. Frequently Asked Questions
8. Final Takeaway

Start With the Error Message

The exact client message helps determine where to start. A timeout, a refused connection, and an authentication failure occur at different stages of the SSH process.

Client message What it usually means First checks
Connection refused The host is reachable, but TCP port 22 is not accepting the session. SSH status, RSA keys, VTY transport
Connection timed out The client cannot complete the path to the management interface. VLAN, routing, VRF, ACL, firewall
No route to host The client has no usable route to the destination. Default gateway, routing table, management subnet
Permission denied The SSH service responds, but authentication fails. Username, AAA, password, login method
Host key or cipher error The client and switch cannot agree on SSH parameters. IOS XE release, SSH version, client algorithms

A switch can respond to Ping while still refusing SSH. Ping only confirms that some IP traffic reaches the device; it does not prove that the SSH server is enabled or that TCP port 22 is permitted.

Confirm the Management Path Before Changing SSH

When the error is a timeout, start with the management path rather than regenerating keys. Check whether the management SVI or management interface is configured correctly and operational.

  • Is the management SVI or management interface using the expected IP address?
  • Is the interface operational?
  • Is the client in the correct management VLAN?
  • Is the default gateway or route available?
  • Is the switch using a management VRF?
  • Is TCP port 22 blocked by an upstream firewall or ACL?
  • Is the client connecting to the correct address?

Use the following commands from the console or another working management session:

show ip interface brief show running-config | section interface Vlan show running-config | section vrf show access-lists

The management interface should have the expected address and an operational state. If the SVI is down, checking RSA keys or VTY lines will not solve the problem.

For a client in another subnet, verify the complete path in both directions. A firewall may allow ICMP while blocking TCP/22, which can produce a successful Ping but an SSH timeout.

Check the SSH Service and RSA Keys

After confirming reachability, check the SSH service itself:

show ip ssh show ssh

The show ip ssh command displays the SSH version and parameters such as the authentication timeout and retry count. The show ssh command displays active SSH server connections.

A message indicating that no SSH sessions are currently running does not necessarily mean that SSH is disabled. It may simply mean that no session is active at that moment. Use show ip ssh to check the service status and version.

If SSH is disabled, check whether the device has a usable RSA key pair. Cisco states that RSA key generation is required for an IOS XE SSH server. The current Cisco Secure Shell Configuration Guide also explains SSH version selection and RSA key requirements.

A basic IOS XE reference configuration may include:

hostname C9200 ip domain name example.com username admin privilege 15 secret <password> crypto key generate rsa modulus 2048 ip ssh version 2

This is a troubleshooting reference, not a universal copy-and-paste configuration. The exact key size, authentication model, and command syntax should match the switch model, IOS XE release, and security policy.

Verify VTY and Authentication Settings

If the SSH service is enabled but the client still receives Connection refused or is disconnected immediately, inspect the VTY configuration:

show running-config | section line vty

A local-authentication example may look like this:

line vty 0 4 login local transport input ssh

If the VTY lines allow only Telnet, or do not permit SSH, the switch may reject SSH even though the management IP is reachable.

Common Authentication Problems

  • RSA keys were never generated.
  • ip ssh version 2 is missing or does not match the client.
  • The VTY lines do not permit SSH.
  • login local is missing when local authentication is intended.
  • The configured username is absent or has the wrong privilege.
  • An AAA server is unavailable.
  • A VTY access-class blocks the client source address.

Also check whether an access-class is applied to the VTY lines:

show running-config | section line vty show access-lists

A VTY access-class can allow only specific source subnets or management hosts. This can create a situation where SSH works from one network but fails from another.

If the switch uses centralized AAA, verify the authentication method and the reachability of the TACACS+ or RADIUS servers before changing the local username configuration. Replacing AAA settings during an outage can remove the remaining working access path.

Troubleshoot SSH After an IOS XE Upgrade

An IOS XE upgrade does not always mean that the SSH configuration has been removed. However, an upgrade can expose differences in keys, algorithms, management interfaces, VRFs, AAA behavior, or inherited configuration.

Compare the pre-upgrade and post-upgrade outputs for:

show ip ssh show running-config | section line vty show running-config | include username show running-config | include ip ssh show running-config | include crypto key show ip interface brief

Post-Upgrade Checks

  • Confirm that the management IP is still configured on the expected interface.
  • Confirm that the RSA host key still exists.
  • Confirm that SSH version 2 is enabled.
  • Confirm that the VTY lines still permit SSH.
  • Confirm that the AAA method list and server reachability are unchanged.
  • Check whether the client rejects the switch because of an unsupported key exchange, cipher, or host-key algorithm.
  • Confirm that the client is using the correct management VRF when one is configured.

Avoid assuming that the upgrade itself is the root cause. Compare the actual configuration and client error before making changes.

Catalyst 9200, 9300, 9500, and C1300 Scope

This troubleshooting approach is intended for Cisco Catalyst platforms running IOS XE, including C9200-24P-E, C9200-48P-E, C9200L access switches, C9300 and C9300L switches, C9500-16X, and C9500-24Y4C.

The physical role of the switch does not change the basic troubleshooting sequence, but the available management interfaces, VRF design, software release, and platform-specific commands can differ.

Catalyst 1300 Is a Separate Case

Do not directly apply the IOS XE commands in this guide to the Cisco Catalyst 1300. The Catalyst 1300 uses a different software and management design, with Web UI and platform-specific CLI behavior.

If the device is a C1300, first confirm the exact model and software interface. Use the corresponding Catalyst 1300 administration and CLI documentation instead of assuming that commands for the C9200 or C9300 will apply.

Information to Send for a Configuration Review

If the issue cannot be resolved locally, prepare the following information:

  • Exact switch model and SKU
  • IOS XE version
  • Error message from the SSH client
  • Source IP address and destination management IP
  • Whether Ping succeeds
  • Output from show ip ssh
  • Output from show ssh
  • Output from the VTY configuration
  • Management interface or SVI status
  • Whether the switch uses AAA or a management VRF
  • Whether the problem started after an upgrade or configuration change
Need help diagnosing a Cisco SSH issue?

Send the model, IOS XE version, error message, and command output for review.

Frequently Asked Questions

Q1 Why can I Ping my Cisco switch but not SSH to it?

Ping and SSH use different protocols. The switch may respond to ICMP while TCP port 22 is disabled, blocked by an ACL, restricted by a VTY access-class, or unavailable because the RSA keys are missing.

Q2 What does Connection refused mean on a Cisco switch?

It usually means that the destination IP is reachable, but the SSH connection is not being accepted. Check show ip ssh, RSA keys, VTY transport settings, and access restrictions.

Q3 What is the difference between SSH timeout and connection refused?

A timeout usually indicates that the client cannot complete the management path. Connection refused usually indicates that the host was reached but no SSH service accepted the TCP connection. Investigate the two errors separately.

Q4 How do I verify whether SSH is enabled?

Run show ip ssh from the console or another working management session. The output should identify the enabled SSH version and authentication parameters when the service is active.

Q5 What does transport input ssh do?

It allows SSH connections on the selected VTY lines. It does not replace the need for a reachable management IP, RSA keys, authentication, or suitable VTY access restrictions.

Q6 Why did SSH fail after an IOS XE upgrade?

Possible causes include a changed management interface, missing or changed RSA keys, VTY configuration differences, AAA changes, VRF changes, or incompatibility between the new SSH parameters and the client. Compare the configuration and client error before changing the switch.

Q7 Can I use this procedure on a Catalyst 1300?

Not directly. Catalyst 1300 uses a different platform and management model. Use its specific administration and CLI documentation instead of assuming that IOS XE commands apply.

Final Takeaway

SSH troubleshooting becomes faster when the error message is treated as a diagnostic clue rather than a generic configuration failure.

Start with the management path for a timeout. Check the SSH service, RSA keys, and VTY lines for a refused connection. Check usernames, AAA, and access restrictions when the switch presents an authentication prompt but rejects the login.

For a configuration-specific review, send the exact model, IOS XE version, client error, and relevant command output through the Cisco switch inquiry page.