by Cyrus Lok on Thursday, April 8, 2010 at 11:13pm

RTR-1(config)#crypto key generate rsa modulus 2048% Please define a domain-name first. To be honest, it couldn’t be more descriptive! You can’t generate an RSA key-pair without a hostname, and a domain name. Router(config)#crypto key generate rsa general-keys modulus 1024% Please define a hostname other than Router. Router(config)#crypto key generate rsa% Please define a hostname other than Router. Router(config)#hos Router(config)#hostname ISR lexnetISR(config)#crypto key generate rsa general-keys modulus 1024% Please define a domain-name first.

I have a generated RSA key which is stored in my ASA’s flash memory. I am going to recreate a RSA key once more, so I will zeroize the key. If there is a RSA key stored in the flash, ASA will prompt whether I want to replace the current generated key with the old one.

Dec 12, 2017 Re: crypto key generate rsa please define a hostname other than switch when you have added the domain name as Julio stated and you go to create the keys again the default will be 512, type 1024 and hit return so it only uses ssh v2 as v1 is unsecure and can be hacked and its advised to not use it anymore where possible. Router(config)#crypto key generate rsa general-keys modulus 1024% Please define a hostname other than Router. Router(config)#crypto key generate rsa% Please define a hostname other than Router. Router(config)#hos Router(config)#hostname ISR lexnetISR(config)#crypto key generate rsa general-keys modulus 1024% Please define a domain-name first. Configure a domain name with the ip domain-name command followed by whatever you would like your domain name to be. I used CiscoLab.com. LabRouter(config)#ip domain-name CiscoLab.com. We generate a certificate that will be used to encrypt the SSH packets using the crypto key generate rsa.

Zeroize the key:

ciscoasa(config)# crypto key zeroize rsa
WARNING: All RSA keys will be removed.
WARNING: All device digital certificates issued using these keys will also be removed

Do you really want to remove these keys? [yes/no]: y
ciscoasa(config)#

Generating RSA key needs to define a domain name, this is the same as in IOS.

ciscoasa(config)# domain-name cyruslab.com
ciscoasa(config)#

Microsoft project 2013 product key. Its earlier version was released in 1998 and time to time it has added new tools and debugs each later version.

Generate a 1024-bit long RSA key:
ciscoasa(config)# crypto key generate rsa general-keys modulus 1024
INFO: The name for the keys will be: <Default-RSA-Key>
Keypair generation process begin. Please wait…
ciscoasa(config)#

Actually it is sufficient if I just type crypto key generate rsa <cr>, the interactive prompt will just prompt me for the length of the key (modulus).

This is the 1024-bit long RSA key which I have just generated:

ciscoasa(config)# sh crypto key mypubkey rsa
Key pair was generated at: 06:20:15 UTC Apr 8 2010
Key name: <Default-RSA-Key>
Usage: General Purpose Key
Modulus Size (bits): 1024
Key Data:

30819f30 0d06092a 864886f7 0d010101 05000381 8d003081 89028181 00c2890c
ad9065a0 f17eebbd 726029dc 0a9f40a9 ca714031 5de9d15b fe7b8fc7 e11e7ffd
8f27befc beaf0aae fa937c69 482a1595 f8865cc1 d8ced14a 737243c3 8f9886ab
75be998a 8a7437a1 bac57f34 d31774b7 a53cd803 a7837bc4 92f9f326 8fc818a5
54ca0476 3c864534 7b50d635 88905d28 cfeec63d e32324a9 98eba845 3b020301 0001

Allow ssh connection from my private network:
ciscoasa(config)# ssh 192.168.1.0 255.255.255.0 inside

Allow ssh connection from the internet (any connection):
ciscoasa(config)# ssh 0 0 outside

Set up ssh idle time-out period (maximum is 1hour):
ciscoasa(config)# ssh timeout 30

ssh has two versions: 1 and 2. ssh version 1 is less secured than version 2. My default ssh supports two versions:

ciscoasa(config)# sh ssh
Timeout: 30 minutes
Versions allowed: 1 and 2
192.168.1.0 255.255.255.0 inside
0.0.0.0 0.0.0.0 outside

To support only version 2, I have to explicitly tell my firewall with this command:
ciscoasa(config)# ssh version 2

ciscoasa(config)# sh ssh
Timeout: 30 minutes
Version allowed: 2
192.168.1.0 255.255.255.0 inside
0.0.0.0 0.0.0.0 outside

I think putty supports ssh version 2. so I shall test it…

A security warning came up because this RSA signature key has not been verified by any CA, this is generated by ASA. However this can be trusted because I generated it 😉

Click yes button to store this key into my windows XP.

I could not find a command to set up the username for remote login, but the default for pix/asa is pix…zzz

Great! Putty supports ssh version 2.

From my console, I can check the current ssh sessions to my ASA5505:

To show current ssh sessions.

To kill ssh session:

ssh disconnect <sid> for disconnecting ssh session.

kill <sid> for killing telnet session.

LOL! SSH session has been sniped!

Cisco Crypto Key Generate Rsa Please Define A Domain Name First

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. Setup Management IP

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.

Crypto Key Generate Rsa Please Define A Domain Name First Day

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.

Crypto Key Generate Rsa Please Define A Domain Name First Word

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