Cisco IOS
SSH Setup Generator
Generate complete SSH configuration for Cisco devices
What is SSH?
Secure Shell (SSH) gives encrypted remote CLI access to your devices. It replaces Telnet, which sends usernames and passwords in clear text.
- Always use SSH version 2 only.
- Routers and switches need an RSA key pair to accept SSH connections.
- Use local users or AAA (RADIUS/TACACS+) instead of simple line passwords.
SSH Building Blocks
| Component | Example | Purpose |
|---|---|---|
| Hostname | hostname SW-CORE-01 | Used in the device identity and prompts. |
| Domain | ip domain-name lab.local | Required for RSA key generation. |
| Keys | crypto key generate rsa modulus 2048 | Creates SSH server keys. |
| User | username admin secret Str0ngP@ss! | Login account with encrypted password. |
| VTY lines | line vty 0 15 | Enable SSH and choose login method. |
SSH Hardening Tips
- Disable Telnet:
transport input sshonly on VTY lines. - Use exec-timeout to log out idle sessions automatically.
- Restrict source IPs with an ACL applied to management lines.
conf t
hostname SW-CORE-01
ip domain-name mynetwork.local
crypto key generate rsa modulus 2048
!
username admin privilege 15 secret Str0ngP@ss!
!
ip ssh version 2
ip ssh time-out 60
ip ssh authentication-retries 3
!
line vty 0 15
transport input ssh
login local
exec-timeout 5
!
line con 0
exec-timeout 5
logging synchronous
!
end
copy running-config startup-config