Connect to the switch: Use a console cable or Telnet to connect to the switch’s command-line interface (CLI). You’ll need the appropriate credentials to access the switch.
The first step is to generate and RSA key pair; enter the global configuration mode by typing ‘configure terminal’ or ‘conf t’. Now lets generate the RSA keypair using the following command ‘crypto key generate rsa’. You will be prompted to specify the key modulus size, I would recommend at least 2048 bits.
Example:
Switch(config)# crypto key generate rsa
The name for the keys will be: switch
Choose the size of the key modulus in the range of 360 to 2048 for your
General Purpose Keys. Choosing a key modulus greater than 512 may take
a few minutes.
How many bits in the modulus [512]: 2048
Configure SSH version and authentication: Enter the SSH configuration mode using the ‘ip ssh’ command and specify the desired SSH version (v1,v2 or both) and enable authentication using local usernames and passwords. Also make sure that you have configured at least one “local login” account an example is below.
Switch(config)# username john privilege 15 password mypassword
Switch(config)# ip ssh version 2
Switch(config)# ip ssh authentication-retries 3
Switch(config)# ip ssh time-out 60
Now we can configure the VTY lines for SSH, in the global configuration mode, access the line configuration mode for the VTY lines using the ‘line vty’ command. Set the transport input to SSH and specify the SSH authentication method.
Switch(config)# line vty 0 15
Switch(config-line)# transport input ssh
Switch(config-line)# login local
Save your configuration using the ‘write’ or ‘copy running-config startup-config’ command to save the configuration changes.
Switch(config)# write / Or wr or copy running-config startup-config
You have completed the steps, SSH should be enabled on your Cisco switch. You can now try and connect to the switch using an SSH client, like Putty or OpenSSH.
Thanks again for visiting Unreal-Labs, You can also check out the Unreal-Labs youtube channel for a video demonstration of this configuration.



