This is a very basic tutorial on how to get SSH running on a Cisco router.  We’re going to set the hostname of the router, set the domain-name, setup a user, generate a private key and enable ssh on the virtual terminal interfaces.  Some of this might already be done, such as hostname and domain name, but they are required to get SSH to work, so we’ll go over it anyways.  If its already set, there isnt any need to change it.
How I have this written is as follows:
- Bold is what you need to input into the router
- Anything inside <xxx> is an option or name you get to choose.
Here goes…
- Router> enable
- Router# conf t
- Router(config)# hostname <gateway>ÂÂ
- Router(config)# ip domain-name <domain.local>
- Router(config)# username <cisco> privilege 5 secret <Password123>
- Router(config)# aaa new-model
- Router(config)# aaa authentication login default local
- Router(config)# aaa authorization exec default local
- Router(config)# crypto key generate rsa
- Make sure the Modulus is at least 2048, if you have an older router it might default to 512.
- If you leave it at 512, quit now.  There’s no hope for you.
- Router(config)# ip ssh time-out <60>
- Router(config)# ip ssh authentication-retries <2>
- Router(config)# line vty 0 4
- Router(config)# transport input ssh
Don’t forget to do a ‘write mem’ and ‘copy running-config startup-config’, or you’ll be doing this all over again next time you reboot your router.
More Stories
Helpful Cisco Commands
Comcast IPv6 Cisco IOS setup
Best Cisco IOS Trick Ever!!