SSH version 2 with local authentication Recommended / essential starting point
Start in privileged EXEC; block enters and exits configuration mode.Section link
Key generation may prompt or reject replacement if a key already exists. Do not overwrite an existing working key unnecessarily.
enable
configure terminal
hostname [HOSTNAME]
ip domain-name [DOMAIN-NAME]
username [USERNAME] privilege 15 secret [PASSWORD]
crypto key generate rsa modulus 2048
ip ssh version 2
line vty 0 [VTY-LAST]
login local
transport input ssh
exit
end
Command parameters
[HOSTNAME]
Local Cisco device hostname.
[DOMAIN-NAME]
Device domain name.
[USERNAME]
Local user account name.
[PASSWORD]
New local or line password; never include a real password in shared material.
[VTY-LAST]
Last VTY line number supported by the device; configure remaining lines as needed.
Optional SSH and VTY timeouts Optional when requested
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
ip ssh time-out [SSH-TIMEOUT-SECONDS]
ip ssh authentication-retries [RETRY-COUNT]
line vty 0 [VTY-LAST]
exec-timeout [IDLE-MINUTES][IDLE-SECONDS]
exit
end
Command parameters
[SSH-TIMEOUT-SECONDS]
SSH negotiation/authentication timeout in seconds.
[RETRY-COUNT]
SSH authentication retry count.
[VTY-LAST]
Last VTY line number supported by the device; configure remaining lines as needed.