Crypto Key Generate Rsa Command Not Working

Posted on by

Q: I have a Cisco switch in my network, which I can access by hooking up a console cable directly to the device. I like to access the switch remotely using SSH. How can I enable ssh on my Cisco 3750 Catalyst Switch?
A: By default, when you configure a Cisco device, you have to use the console cable and connect directly to the system to access it. Follow the steps mentioned below, which will enable SSH access to your Cisco devices. Once you enable SSH, you can access it remotely using PuTTY or any other SSH client.

  1. Crypto Key Generate Rsa 2048
  2. Crypto Key Generate Rsa Command Not Working On Mac
  3. Crypto Key Generate Rsa Command

1. Setup Management IP

Switch(config)#crypto key generate rsa The name for the keys will be: ##### 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: 768% Generating 768 bit RSA keys, keys will be non-exportable.OK Switch(config)#ip ssh% Incomplete command. The label is important, I'll tell you! In a minute why C1801(config)# crypto key generate rsa modulus 1024 label C1801 The name for the keys will be: C1801% The key modulus size is 1024 bits% Generating 1024 bit RSA keys, keys will be non-exportable.OK C1801(config)#.Jan 6 15:22:25.339:%SSH-5-ENABLED: SSH 1.99 has been enabled! Router1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#crypto key generate rsa The name for the keys will be: Router1.oreilly.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. Java.security.NoSuchAlgorithmException: RSA KeyGenerator not available at javax.crypto.KeyGenerator.(KeyGenerator.java:169) at javax.crypto.KeyGenerator.getInstance(KeyGenerator.java:223) Now I will try to create a symmetric key using keytool and RSA algorithm parameter. Click on 'telnet session to the switch console.' - This will open a black command prompt looking window. Press any key to continue Type in your username Type in your password Type in 'config' (This is the step it is left out of most other directions) Type in 'crypto key generate ssh' The switch will now generate a key.

First, make sure you have performed basic network configurations on your switch. For example, assign default gateway, assign management ip-address, etc. If this is already done, skip to the next step.

In the following example, the management ip address is set as 192.168.101.2 in the 101 VLAN. The default gateway points to the firewall, which is 192.168.101.1

2. Set hostname and domain-name

Next, make sure the switch has a hostname and domain-name set properly.

3. Generate the RSA Keys

The switch or router should have RSA keys that it will use during the SSH process. So, generate these using crypto command as shown below.

Also, if you are running on an older Cisco IOS image, it is highly recommended that you upgrade to latest Cisco IOS.

4. Setup the Line VTY configurations

Setup the following line vty configuration parameters, where input transport is set to SSH. Set the login to local, and password to 7.

If you have not set the console line yet, set it to the following values.

5. Create the username password

If you don’t have an username created already, do it as shown below.

Note: If you don’t have the enable password setup properly, do it now.

Make sure the password-encryption service is turned-on, which will encrypt the password, and when you do “sh run”, you’ll seee only the encrypted password and not clear-text password.

5. Verify SSH access

From the switch, if you do ‘sh ip ssh’, it will confirm that the SSH is enabled on this cisco device.

After the above configurations, login from a remote machine to verify that you can ssh to this cisco switch.

In this example, 192.168.101.2 is the management ip-address of the switch.

> Add your comment

If you enjoyed this article, you might also like.



Next post: How to Backup Oracle Database using RMAN (with Examples)

Previous post: How to Use C++ Single and Multiple Inheritance with an Example

Learning has never been so easy!

This How-To guide will walk you through setting up (configuring and enabling) SSH on a HP ProCurve Switch using the Web Interface.
It assumes you can access the switch via the web interface and have read-write access.
This walkthrough does NOT implement Client Public Key Authentication and has the Switch Authenticate against itself.

4 Steps total

Step 1: Log into the Switch

Crypto Key Generate Rsa 2048

Log into the switch's Web interface using an account with read-write permissions.

Step 2: Create a Certificate

Note: This step will create a self-signed certificate but you can also create a request and have your Enterprise CA sign it if your environment has it available.

On the Security Tab, Select Create Certificate/ Create Request.
Select Self-Signed from the drop down box and fill in the appropriate fields.
be sure the Validity start and end dates are current.

Click Apply Changes to create the certificate.

Step 3: Generate a Private/Public Key pair

Navigate over to the Configuration Tab
Click on 'telnet session to the switch console.' - This will open a black command prompt looking window.
Press any key to continue
Type in your username
Type in your password
Type in 'config' (This is the step it is left out of most other directions)
Type in 'crypto key generate ssh'
The switch will now generate a key.
If this step fails, verify your are in 'config'mode

Step 4: Enable SSH

Now that you have created a certificate and the appropriate keys, you can enable SSH on the switch.

Type in 'ip ssh' in the Telnet CLI.
Thats it. SSH should now be enabled.

You can verify its enabled by typing in 'show ip ssh'

After following these instructions, you should have been sucessfully able to configure and enable SSH on your HP ProCurve Switch. The steps and screenshot in this How-To were completed using the latest Firmware for that switch 'N.11.48'.
You should now be able to have Spiceworks scan your switches using SSH which will allow spiceworks to monitor and backup their configuration.

Published: Sep 07, 2011 · Last Updated: Sep 21, 2017

References

Crypto Key Generate Rsa Command Not Working On Mac

  • HP Access Security Guide

5 Comments

Crypto Key Generate Rsa Command

  • Poblano
    TeBear Dec 10, 2013 at 04:24pm

    I found there is no need for Step 1 or Step 2

    Telnet into switch and run following commands:

    >enable
    >config
    >crypto key generate ssh

    Seems to do the trick. looks like ssh is enabled out of the box (Step 4) on Procurve though you need to generate the key to be able to use it.

  • Serrano
    BoJlk Jan 6, 2014 at 07:49am

    Thanks for the steps.
    you must crypto key generate ssh in config mode before enabling SSH on your switch.
    Step 2 - Create a Certificate helpfull if you want to access with HTTPS to your switch.

    Hi Sean,You don't have to make the Hmac key from the code. It is very simple in two three steps to get the Hmac key.First login to your Demo Payeezy account then open the terminals Shown on your Right side of window.Then Click one terminal Then it will open a window, then select API Access window.Then copy Copy Key Id and paste it on APIKey section in your codeThen below is the Hidden HMAC key hidden as Password, then click 'Generate New Key'.It will gives you HMAC key. Copy it, Paste it in your code and Update the form. Generate hmac sha256 key chart.

  • Serrano
    Felix_da_CAT5 May 16, 2014 at 08:03am

    isnt it necessary to save the configuration after any alteration in order to keep working after a reboot?

  • Cayenne
    Nathan Bareham Aug 2, 2014 at 07:22pm

    i can scan, but the config does not seem to be backing up. any ideas?

  • Chipotle
    Dr-Drew Nov 25, 2015 at 10:00pm

    Always a good idea to 'write mem' when your done in the CLI.. :o)