MENU CLOSE

How to enable SSH on Cisco Devices?

We are enabling the ssh on the Cisco devices with below commands;

 

 

 

 

 

 

 

 

oslo-router# configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

oslo-router(config)#crypto key generate rsa general-keys

The name for the keys will be: oslo-router.emin.local

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      //////// you can set 2048 or more bits

% Generating 1024 bit RSA keys, keys will be non-exportable…[OK]

oslo-router(config)#

*Mar 1 1:1:59.726: %SSH-5-ENABLED: SSH 1.99 has been enabled

 

oslo-router(config)#ip ssh version 2  //// I want to use ssh version 2

oslo-router(config)#username lord secret cisco  //////////creating a username and password for the ssh connection

oslo-router(config)#line vty 0 4                             ////////// I am allowing 5 connection at the same time  to the device

 

I am activating the ssh log in  below

oslo-router(config-line)#transport input ssh

oslo-router(config-line)#log

oslo-router(config-line)#login local

oslo-router(config-line)#log

oslo-router(config-line)#logging sync

oslo-router(config-line)#exit

 

 

///////

next step:Assign IP addresses to interfaces on router/switch

oslo-router(config)#interface gigabitEthernet 0/0  (I am choosing this interface )
oslo-router(config-if)#ip ad
oslo-router(config-if)#ip ad
oslo-router(config-if)#ip address 10.0.0.1 255.255.255.128  (assigning an IP address)

oslo-router(config-if)#no shutdown (enabled the interface )

oslo-router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

 

I am enabling 2. interface of the router

oslo-router(config)#interface gigabitEthernet 0/1  ( (I am choosing this interface ))
oslo-router(config-if)#ip address 10.0.0.130 255.255.255.128 ((assigning an IP address))

oslo-router(config-if)#no shutdown ((enabled the interface ))

oslo-router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up

oslo-router(config)#exit

oslo-router(config)#exit

 

///

we can copy the config to startup-config… (If you reboot your device, your config will be safe := )

 

oslo-router#copy running-config startup-config

Destination filename [startup-config]?

Building configuration…

[OK]

oslo-router#

 

 

*///

You can now try ssh to the cisco device 🙂

 

 

Share your thoughts