000037699 - RSA NetWitness Logs & Network 11.x ssh login fails with error "no hostkey alg"

Document created by RSA Customer Support Employee on Jul 16, 2019
Version 1Show Document
  • View in full screen mode

Article Content

Article Number000037699
Applies ToRSA Product Set: NetWitness Logs & Network
RSA Version/Condition: 11.x
Platform: CentOS
O/S Version: 7
IssueTrying to ssh login to a NetWitness 11.x appliance fails returning the error message, "no hostkey alg"
 

putty 192.168.1.1

[SSH] Server Version OpenSSH_7.4
[SSH] FAIL: no hostkey alg


[SSH] INFO: DISCONNECT
CauseCentOS7 ssh security has increased where the RSA and DSA HostKey algorithms by default are no longer configured to be used by the sshd service.

Instead, the CentOS7 sshd service is now configured to use the ECDSA and ED25519 HostKey algorithms.

Older versions of ssh client software like putty.exe versions older than 0.70, and CentOS6 ssh can only use the RSA and DSA HostKey algorithms or are only configured to use these older HostKey algorithms.
Resolution
  1. For putty client software upgrade to version 0.70 or newer.
  2. For other 3rd party ssh client software upgrade to their latest version that supports the ECDSA and ED25519 HostKey algorithms.
  3. For CentOS6 ssh version 5.3 and above it can support the ECDSA HostKey algorithm, but it needs to be configured.

SSH login to the CentOS6 appliance.

Check the ssh version is 5.3 or above with the command,
 
ssh -V


If the ssh version is 5.3 or above then add the ECDSA HostKey algorithm to the ssh_config file,
 
cd /etc/ssh
 


cp -p ssh_config ssh_config.orig

echo "HostKeyAlgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ssh-rsa,ssh-dss" > /etc/ssh/ssh_config

service sshd restart


Test the change by trying to ssh login to a NetWitness 11.x appliance.
WorkaroundWhilst upgrading the CentOS6 ssh HostKeyAlgorithms security to ecdsa-sha2-nistp256 or ecdsa-sha2-nistp384 is the preferred solution, if this is not acceptable, the following 2 other alternatives can be considered but are less preferred.
  1. "Upgrade" the CentOS6 system to CentOS7.
      Note this option is not available for the nw-backup tool backup server as this tool requires CentOS6, refer to nw-backup requirements in the RSA Security Analytics Configuration Data Backup and Restore Guide for version 10.6.6
     
  2. Downgrade the sshd security of the NetWitness 11.x appliances.
     
To return sshd security back to the level of CentOS6.

Do this on all the Netwitness 11.x appliances with the following commands,

Confirm the following 2 files exist.
 
ls -l /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_dsa_key


If any of the 2 files don't exist then create the missing file with commands,
 
ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_dsa_key


chgrp ssh_keys /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_dsa_key


Update the sshd_config file to allow use of the RSA and DSA HostKey algorithms,
 
cd /etc/ssh/
cp -p sshd_config sshd_config.orig
vi sshd_config


Uncomment the lines, or add the lines if they are missing in the sshd_config file,
 
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key


Restart the sshd service,
 
systemctl restart sshd
NotesSSH supports several public key HostKey algorithms for authentication keys. These include:

RSA - an old algorithm based on the difficulty of factoring large numbers. A key size of at least 2048 bits is recommended for RSA; 4096 bits is better.  RSA is getting old and significant advances are being made in factoring.  Choosing a different Hostkey algorithm may be advisable.  It is quite possible the RSA algorithm will become practically breakable in the foreseeable future.  All SSH clients support this algorithm.

DSA - an old US Government Digital Signature Algorithm.  It is based on the difficulty of computing discrete logarithms.  A key size of 1024 would normally be used with it.  DSA in its original form is no longer recommended.

ECDSA - a new Digital Signature Algorithm standardized by the US government, using elliptic curves.  This is probably a good algorithm for current applications.  Only three key sizes are supported: 256, 384, and 521 (sic!) bits.  We would recommend always using it with 521 bits, since the keys are still small and probably more secure than the smaller keys (even though they should be safe as well).  Most SSH clients now support this algorithm.

ED25519 - this is a new algorithm added in OpenSSH.  Support for it in clients is not yet universal.  Thus its use in general purpose applications may not yet be advisable.

Attachments

    Outcomes