How to configure SSH in Cisco Router

Saturday, August 13, 2016

Prepare one topology with the combination of Cisco routers and switches. Make sure your network is working properly. Now in topology you can configure SSH in any of the router you want.



Now if you have chosen router where you will configure SSH Start configuring it.

1. Set hostname and domain-name


Here are some commands to set hostname and Domain name for the router

# config t
(config)# hostname cbitss
(config)# ip domain-name Cbitss.com

2. Generate the RSA Keys
Router should have RSA keys that it will use during the SSH process. Yo can set this with the command given bellow.
cbitss(config)# crypto key generate rsa
 The name for the keys will be: cbitss.cbitss.com
 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]: 1024
 % Generating 1024 bit RSA keys, keys will be non-exportable...[OK]


3. Setup the Line VTY configurations
Here in Line VTY you need to set SSH as input method. You also can set it to login local.
# line vty 0 4
(config-line)# transport input ssh
(config-line)# login local
(config-line)# exit

4. Create the username password
Here yo need to set username and password by which you have to login in router.
cbitss# config t
Enter configuration commands, one per line.  End with CNTL/Z.

cbitss(config)# username cbitss password cbitss@123

You also need to set Enable passwords.
cbitss# enable secret admin@cbitss
cbitss# service password-encryption


5. Verify SSH access
On router to check either SSH is enabled or not you need to ru bellow commands.
cbitss# sh ip ssh
SSH Enabled - version 1.99
Authentication timeout: 120 secs; Authentication retries: 3
After checking the status of the SSH now you can take access from computer to router. To take access from PC to router you can run  following commands
remote-machine# ssh 192.168.101.2
login as: cbitss
Using keyboard-interactive authentication.
Password:

cbitss>en
Password:
cbitss#
Like this you can configure SSH in any Cisco Device.


0 comments:

Post a Comment