Configure SSH on cisco router or switch

 

Router# conf t
Router(config)# ip ssh version 2

Change your Router name or else you will get below error later
“Please define a hostname other than Router”

Router(config)# hostname R

Configure DNS domain name:

R(config)# ip domain-name example.com

Generate a certificate that will be used to encrypt the SSH packets

R(config)# crypto key generate rsa label KimSSH-key
How many bits in the modulus [512]: 1024

Allow local user for SSH login

R(config)# line vty 0 4
R(config-line)# login local
R(config-line)# transport input ssh
! Session expires after 5 mins
MOLR(config-line)#exec-timeout 5

Create a user for ssh with very strong password

R(config)# username kim privilege 15 secret yourStrongPassword

//FOR SECURITY PURPOSE//

//Remember to disable all except ssh
R(config)# line vty 0 4
R(config-line)# transport input ssh

//Enable SSH to only your local or certain address

R(config)# access-list 1 permit 192.168.1.0 0.0.0.255
R(config)# line vty 0 4
R(config-line)# access-class 1 in

Leave a Comment

Your email address will not be published. Required fields are marked *