04-23-2010 10:32 AM - edited 03-11-2019 10:36 AM
I can't access our ASA 5505 via SSH from the outside. I've configured this through the ASDM to allow SSH (Device Management > Management Access > ASDM/HTTPS/Telnet/SSH). I added a rule that allows SSH on the outside interface from 0.0.0.0 0.0.0.0. When I try to ssh in with putty, it says "server unexpectedly closed network connection" When I watch the logs on the ASA, it shows a Built inbound TCP connection on port 22, but then immediately a Teardown TCP connection. It doesn't show it's being blocked by any rule. Is there something I'm missing on enabling SSH?
Thanks,
Scott
Solved! Go to Solution.
04-23-2010 10:40 AM
Hi,
Besides allowing the permitted hosts to SSH to the ASA, you need to define RSA keys for the secure connection.
In the CLI:
crypto key generate rsa
For these key to work, you should have a hostname/domain-name configured on the ASA as well (unless you configure a dedicated RSA keys).
So basically, configure a hostname, domain name and generate the RSA key pair:
hostname NAME_OF_ASA
domain-name NAME_OF_DOMAIN
crypto key generate rsa
Accept the default of 1024 and it should work.
Federico.
04-23-2010 10:40 AM
Hi,
Besides allowing the permitted hosts to SSH to the ASA, you need to define RSA keys for the secure connection.
In the CLI:
crypto key generate rsa
For these key to work, you should have a hostname/domain-name configured on the ASA as well (unless you configure a dedicated RSA keys).
So basically, configure a hostname, domain name and generate the RSA key pair:
hostname NAME_OF_ASA
domain-name NAME_OF_DOMAIN
crypto key generate rsa
Accept the default of 1024 and it should work.
Federico.
04-23-2010 10:50 AM
Thanks for your response.
I had to enter that command through the ASDM and got the results below. Do I need to replace the existing key?
Result of the command: "crypto key generate rsa"
WARNING: You have a RSA keypair already defined named
Do you really want to replace them? [yes/no]:
% Please answer 'yes' or 'no'.
Do you really want to replace them? [yes/no]:
% Please answer 'yes' or 'no'.
Do you really want to replace them? [yes/no]:
% ERROR: Timed out waiting for a response.
ERROR: Failed to create new RSA keys named
04-23-2010 10:54 AM
Are those RSA keys already in used for something else? If not, you can do: crypto key zeroize and regenerate the RSA keys.
You should be able to SSH fine.
We know the connection is getting to the ASA because you see the log.
Can you regenerate the RSA keys and attempt the connection?
If it does not work, please post the output of the ''sh run ssh'' command and the public IP address where the SSH client connection is coming from.
Federico.
04-23-2010 11:15 AM
I ran "crypto key zeroize" and removed the key, then ran" crypto key generate rsa" to regenerate the key. I tried ssh'ing back in, but got the same error. I checked the logs and saw the same thing again.
Here is the output of sh run ssh
ssh scopy enable
ssh 0.0.0.0 0.0.0.0 inside
ssh 0.0.0.0 0.0.0.0 outside
ssh timeout 60
Thanks,
Scott
08-26-2014 09:25 AM
I'm sure you have this figured out by now. But you have to go to Configuration > Device management > Users/AAA > AAA Access and "Enable" SSH and assign to "LOCAL". Doing a Debug ssh 127 will show you keys to the reason. If you are getting a "no AAA" message then your device is trying to use external AAA. Enable it to Local and you are good to go.
02-13-2015 05:59 AM
Correct. It's AAA authentication what is missing.
04-23-2010 11:32 AM
I wonder if since I'm running these commands from the ASDM CLI, if they're running all the way. I thought when you run the crypto key generate rsa command it asks you some questions. I didn't get anything returned. Is there a way to pull up an actual cli session from the ASDM?
04-23-2010 11:37 AM
Scott,
I think you're correct and the RSA needs to be done via the CLI.
Can you telnet/SSH to the ASA?
Cannot be done via ADSM.
Federico.
04-23-2010 11:49 AM
I can't. It's at a remote location in another country so I don't even have physical access. Not sure how I'm going to do this, but thanks for your help.
04-23-2010 11:53 AM
To be sure, we can run the debug for SSH:
debug ssh 127
The output of this command should tell us what the problem is.
Federico.
04-23-2010 12:09 PM
Is there a way to run this in the ASDM CLI? I tried from but got the message "debug commands are not supported".
04-23-2010 12:27 PM
As far as I've seen you'll need CLI access to enable SSH.
Debugs don't seem to work on ASDM either.
Apologies, I always use CLI only.
Federico.
04-23-2010 01:03 PM
OK. I'll see what I can do. Thanks.
02-08-2012 08:24 AM
you can regenerate the rsa keys from the asdm as well.
use the noconfirm keyword at the end of each command (in Multiline, I use following):
conf t
crypto key zero noconfirm
crypto key generate rsa no confirm
http://www.cisco.com/en/US/docs/security/asdm/6_1/release/notes/rn61.html#wp70204
hope this helps.
Ramzi
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide