|Applies To||RSA Product Set: NetWitness Logs & Network|
RSA Version/Condition: 11.x
O/S Version: 7
|Issue||Trying to ssh login to a NetWitness 11.x appliance fails returning the error message, "no hostkey alg"|
|Cause||CentOS7 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.
SSH login to the CentOS6 appliance.
Check the ssh version is 5.3 or above with the command,
If the ssh version is 5.3 or above then add the ECDSA HostKey algorithm to the ssh_config file,
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.
|Workaround||Whilst 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.|
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,
cp -p sshd_config sshd_config.orig
Uncomment the lines, or add the lines if they are missing in the sshd_config file,
Restart the sshd service,
systemctl restart sshd
|Notes||SSH 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.