Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

Should normally be replaced by SSH

Direct answer

Telnet should normally be replaced by SSH: configure a hostname, domain name and RSA key, ip ssh version 2, and transport input ssh on the VTY lines.

When to use this

Use it when migrating device management from Telnet to SSH.

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 · IOS/IOS XE
Scope / prerequisiteUse it when migrating device management from Telnet to SSH.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

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

1 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 Common mistakes Narrow the fault
  • Forgetting to generate RSA keys before enabling SSH.
  • Allowing SSH v1.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points
  • Replace Telnet with SSH except in a deliberately isolated lab
  • Prefer long unique credentials stored as supported hashes/secrets, not reversible plaintext
  • MFA and certificates reduce reliance on reusable passwords
  • Rotation should be risk/event driven and must not encourage predictable patterns.
ReferenceWhat it is1 section · depth on demand

Migrating to SSH

hostname R1
ip domain name example.com
crypto key generate rsa modulus 3072
ip ssh version 2
username admin privilege 15 algorithm-type scrypt secret <password>
line vty 0 15
 login local
 transport input ssh

Documented example, not captured output. Test SSH in a second session before removing Telnet. Check with show ip ssh and show ssh.

ReferenceWhy it matters1 section · depth on demand

Why replace Telnet

Telnet sends usernames, passwords and every command in clear text over TCP 23, so anyone who can capture traffic on the path can read them. SSH encrypts the session and authenticates the server with its host key. Disable Telnet on all VTY lines and only keep it on isolated lab devices.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Replace Telnet with SSH on every management line

Telnet sends usernames, passwords and every command in clear text. Anyone who can capture traffic on the path can read them. SSH encrypts the session and authenticates the device with a host key.

Enabling SSH on Catalyst 9300 (IOS XE 17.3 guide)

The guide lists hostname and ip domain name (needed for the SSH server) and crypto key generate rsa. It notes that generating an RSA key pair automatically enables SSH, and recommends a modulus of at least 1024 bits. Optional tuning includes ip ssh time-out, ip ssh authentication-retries and rekey settings. show ip ssh shows the server state and show ssh the active sessions.

C9300(config)# hostname acc-sw01
C9300(config)# ip domain name corp.example.com
C9300(config)# crypto key generate rsa modulus 3072 label SSH-KEY
C9300(config)# ip ssh version 2
C9300(config)# ip ssh rsa keypair-name SSH-KEY
C9300(config)# ip ssh time-out 60
C9300(config)# ip ssh authentication-retries 3
C9300(config)# line vty 0 15
C9300(config-line)# transport input ssh
C9300(config-line)# login authentication default
C9300(config-line)# access-class MGMT-ONLY in
C9300# show ip ssh
SSH Enabled - version 2.0
Authentication timeout: 60 secs; Authentication retries: 3

The SSHv2-specific commands (ip ssh version 2) and the VTY settings (transport input ssh) are covered in separate Cisco modules. The 17.3 SSH chapter mainly describes the server setup.

Migration checklist

StepCheck
AAA or local users with secret hashesusername admin privilege 15 secret ...
SSH works from the management stationBefore removing Telnet
transport input ssh on all VTY linesshow running-config | section line vty
Restrict management sourcesaccess-class on VTY lines, management VRF
Disable the HTTP server unless neededno ip http server; use ip http secure-server if required

Test from a second session before closing the first, so a mistake doesn't lock you out.

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

Replacing Telnet with SSH is one of the first hardening steps on any device. SSH encrypts the whole session and lets the client verify it is talking to the right device. The configuration requires a hostname, a domain name and a cryptographic key before SSH can start, and VTY lines must then be restricted to SSH only.

Replacing Telnet with SSH:

hostname R1
ip domain name example.com
crypto key generate rsa modulus 3072 label SSH
ip ssh version 2
ip ssh server algorithm encryption aes256-gcm aes256-ctr
ip ssh time-out 60
ip ssh authentication-retries 3
line vty 0 15
 transport input ssh
 login authentication VTY

Verify with show ip ssh and show ssh. For old devices that cannot do SSH, restrict Telnet to a jump host on an isolated management network until they are replaced.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Configuration

ip domain name corp.local
crypto key generate rsa modulus 3072
ip ssh version 2
line vty 0 15
 transport input ssh
 login local

Documented example, not captured output. Verify: show ip ssh, show line vty 0 15 | include Allowed.

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 → Telnet → Should normally be replaced by 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%
Confirmation

Confirm action

Continue?