Unable to load host key "/nsconfig/ssh/ssh_host_dsa_key": invalid format

Unable to load host key "/nsconfig/ssh/ssh_host_dsa_key": invalid format

book

Article ID: CTX275232

calendar_today

Updated On:

Description

Error when trying to ping or use any functions, such as upgrade Netscaler firmware, cannot setup new FIPS Keys CSRs etc... "Could not open websocket connection. Please try by login again."

Unable to load host key "/nsconfig/ssh/ssh_host_dsa_key": invalid format
sshkey_private_serialize: unknown or unsupported key type
NSG2 monit[986]: 'sshd' failed to start

Resolution

Regenerate a new ssh dsa key
======================
Delete/Backup existing corrupted dsa private and pub key locate in /nsconfig/ssh/

> rm /nsoconfig/ssh/ssh_host_dsa_key
> rm /nsoconfig/ssh/ssh_host_dsa_key.pub

Generate a new dsa private and pub key.
> ssh-keygen -t dsa
Give same location and name as previous key :: /nsconfig/ssh/ssh_host_dsa_key
> reboot or reload config file with command: /usr/sbin/sshd -f /etc/sshd_config


Another solution is disable dsa ssh key as is not really required since rsa key is present.
=================
Edit file /etc/sshd_config and comment out [#] dsa key line
root@adc# cat /etc/sshd_config
Port 22
#ListenAddress 0.0.0.0
#ListenAddress :: Protocol 2
HostKey /nsconfig/ssh/ssh_host_rsa_key
#HostKey /nsconfig/ssh/ssh_host_dsa_key Safe file

Copy sshd_config to /nsconfig/
> cp /etc/sshd_config /nsconfig/
Reload sshd with command:
> /usr/sbin/sshd -f /nsconfig/sshd_config

Problem Cause

Corrupted dsa key after ADC upgrade.