Thursday, March 22, 2012

How to configure SSH on router

Router(config)#int fastEthernet 0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#username neeraj password cisco
Router(config)#ip domain-name cisco.com
Router(config)#crypto key generate rsa
% Please define a hostname other than Router.
Router(config)#hostname bob
bob(config)#crypto key generate rsa
The name for the keys will be: bob.cisco.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]:
% Generating 512 bit RSA keys, keys will be non-exportable...[OK]

bob(config)#ip ssh ver
*Mar 1 0:3:33.415: RSA key size needs to be at least 768 bits for ssh

version 2
*Mar 1 0:3:33.415: %SSH-5-ENABLED: SSH 1.5 has been enabled
bob(config)#ip ssh version ?
<1-2> Protocol version
bob(config)#ip ssh version 2
Please create RSA keys (of at least 768 bits size) to enable SSH v2.
bob(config)#crypto key generate rsa
% You already have RSA keys defined named bob.cisco.com .
% Do you really want to replace them? [yes/no]: y
The name for the keys will be: bob.cisco.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]: 786
% Generating 786 bit RSA keys, keys will be non-exportable...[OK]

*Mar 1 0:4:18.822: %SSH-5-ENABLED: SSH 1.99 has been enabled
bob(config)#ip ssh version 2
bob(config)#line vty 0 15
bob(config-line)#login local
bob(config-line)#transport input ssh
bob(config-line)#^Z
bob#wr
Building configuration...
[OK]

bob#sh ip ssh
SSH Enabled - version 2.0
Authentication timeout: 120 secs; Authentication retries: 3


bob(config)#enable password cisco
bob(config)#^Z
bob#

USES:

bob#ssh -v 2 -l neeraj 192.168.1.1
Open
Password:



bob>en
Password:

bob#sh ip int brief
Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 192.168.1.1 YES manual up up
FastEthernet0/1 unassigned YES unset administratively down
Vlan1 unassigned YES unset administratively down
bob#exit

No comments:

Post a Comment