Use it when migrating device management from Telnet to SSH.
Should normally be replaced by SSH
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.
1. Replace Telnet with SSH v2: hostname, domain, RSA/ECDSA keys, ip ssh version 2, transport input ssh.
2. Use AAA.
3. Restrict with ACLs.
4. Test before disabling Telnet remotely.
5. Audit regularly.
keys → SSH v2 → transport input ssh → Telnet removed
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & 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 Common mistakes Narrow the fault
- Forgetting to generate RSA keys before enabling SSH.
- Allowing SSH v1.
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.
- 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.
show ip ssh— SSH v2 enabledshow running-config | section line vty— transport input ssh
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
| Step | Check |
|---|---|
| AAA or local users with secret hashes | username admin privilege 15 secret ... |
| SSH works from the management station | Before removing Telnet |
transport input ssh on all VTY lines | show running-config | section line vty |
| Restrict management sources | access-class on VTY lines, management VRF |
| Disable the HTTP server unless needed | no 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.
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.
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
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 → 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%