How to Configure ssh on a Cisco Switch.

Telnet is a widely used protocol for accessing and administering Cisco devices. But this protocol is not exactly secure and transmits data over a network in plain text.

Ssh is a secure protocol and it’s best practice to secure your access to all devices. Configuring ssh on most Cisco switch models is a straightforward process. You will need to generate a key and it is recommended to enable the aaa(Authentication, Authorization and Accounting) model.

Here are the steps:

Switch# config t
Switch(config)# ip domain-name
Switch(config)# crypto key generate rsa

At this point, you will be prompted to enter a modulus number for the key generation:

How many bits in the modulus [512]: 1024 (1024 is recommended)
Switch(config)# username admin privilege 15 secret ‘password’ (you could create more usernames)
Switch(config)# aaa new model (To enable the aaa model on the switch)
Switch(config)# line vty 0 15
Switch(config-line)# transport input ssh
Switch(config-line)# no password
Switch(config-line)# transport preferred ssh
Switch(config-line)# exit
Switch(config)# exit
Switch# copy run start (To save the configuration changes)

After these steps, the cisco device could be access using tools such as Putty, Cygwin. Cygwin could also be configured to integrate with your PowerShell interface and save you the time involved in switching between shells. You could also configure the Start-Transcript cmdlet in your PowerShell profile to keep a log of your commands if necessary. This is optional. I hope this helps someone.

This entry was posted in Cisco, Router, ssh, Switch, Telnet. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s