Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

How to replace "cry key generate rsa" when one key is already in place

Folks, I need to paste this config/templace on switches. When there is no cry key gen rsa already in place in the switch, the command works accordingly. If there is a key already in place, then I get prompted for "yes/no" and then I need to enter "800" to select the length I want.

Question: is there any way to force the command below to input "YES" and "800" when I get such prompt?

(...)

!-This one works well if no cry key is in place.

cry key generate rsa

[pick 800] ssh_rsa_verify: RSA modulus too small: 512 < minimum 768 bits

(...)

!- As you can see, if pasted onto a switch which already has the key it hangs there waiting for a command prompt input.

myswitch(config)#cry key generate rsa

% You already have RSA keys defined named domain.c

% Do you really want to replace them? [yes/no]: yes

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]: 800

(...)

1 ACCEPTED SOLUTION

Accepted Solutions
Cisco Employee

Re: How to replace "cry key generate rsa" when one key is alread

Enter the whole command in one shot:

crypto key generate rsa general-keys modulus 800

3 REPLIES
Cisco Employee

Re: How to replace "cry key generate rsa" when one key is alread

Enter the whole command in one shot:

crypto key generate rsa general-keys modulus 800

Cisco Employee

Re: How to replace "cry key generate rsa" when one key is alread

Enter the whole command in one shot:

crypto key generate rsa general-keys modulus 800

New Member

Re: How to replace "cry key generate rsa" when one key is alread

Excellent! Thanks.

777
Views
0
Helpful
3
Replies