Pages

Sunday, November 16, 2014

Please create RSA keys (of atleast 768 bits size) to enable SSH v2

When the router booted up it already had a key pair generated, but our newly created keypair (1024) has a different name.

The ip ssh rsa keypair-name command was also introduced in Cisco IOS Release 12.3(4)T so that you can enable an SSH connection using the RSA keys that you have configured. Previously, SSH was linked to the first RSA keys that were generated (that is, SSH was enabled when the first RSA key pair was generated). The behavior still exists, but by using the ip ssh rsa keypair-name command, you can overcome that behavior. If you configure the ip ssh rsa keypair-name command with a key pair name, SSH is enabled if the key pair exists, or SSH will be enabled if the key pair is generated later. If you use this command to enable SSH, you are not forced to configure a hostname and a domain name, which was required in SSH Version 1 of the Cisco IOS software.

R1#sh crypto key mypubkey rsa
% Key pair was generated at: 00:02:15 UTC Mar 1 2002
Key name: R1.mydomain.com
Storage Device: private-config
Usage: General Purpose Key
Key is not exportable.
Key Data:
<--- ommited --->
% Key pair was generated at: 00:00:05 UTC Mar 1 2002
Key name: R1.mydomain.com.server
Temporary key
Usage: Encryption Key
Key is not exportable.
Key Data:
<--- ommited --->
% Key pair was generated at: 00:03:28 UTC Mar 1 2002
Key name: R1.gns3.com
Storage Device: not specified
Usage: General Purpose Key
Key is not exportable.
Key Data:
<--- ommited --->

R1(config)#ip ssh rsa keypair-name R1.gns3.com
R1(config)#
*Mar  1 00:05:09.039: %SSH-5-DISABLED: SSH 1.5 has been disabled
*Mar  1 00:05:09.055: %SSH-5-ENABLED: SSH 1.99 has been enabled
R1(config)#ip ssh version 2
R1(config)#do sh ip ssh
SSH Enabled - version 2.0
Authentication timeout: 120 secs; Authentication retries: 3