JBY Technologies

Fix the sshd fatal no hostkey alg preauth Error

Beginning with Redhat Enterprise Linux and CentOS 7, the default settings for sshd do not create a DSA host key. This can result in the following error: sshd[pid]: fatal: no hostkey alg [preauth]. This can cause session setup failures for older ssh clients. To allow those connections, perform the below steps. Bear in mind that this change was made to improve security, and this workaround allows weaker encryptions on the affected connections.

cd /etc/ssh

ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key

vi /etc/ssh/sshd_config

Uncomment this line:

HostKey /etc/ssh/ssh_host_dsa_key

chgrp ssh_keys ssh_host_dsa_key

service sshd restart

Then retry the connection with the older client.

Bookmark and Share

Legal Notices