Passwordless SSH login to a remote server with DSA client public key keeps asking user for password
This document (000019837) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server 12
Situation
It can be observed in the OpenSSH client session log a similar line:
debug1: Skipping ssh-dss key .ssh/id_dsa - corresponding algo not in PubkeyAcceptedAlgorithms
And on the remote OpenSSH server log it can be observed this similar line:
Dec 21 12:22:26 remotehost sshd[9463]: userauth_pubkey: key type ssh-dss not in PubkeyAcceptedKeyTypes [preauth]
Resolution
To re-enable ssh-dss (DSA):
On the remote SSH server using OpenSSH, modify /etc/ssh/sshd_config so 'PubkeyAcceptedKeyTypes' includes 'ssh-dss' to accept DSA keys (see sshd_config(5) man page for details):
PubkeyAcceptedKeyTypes=+ssh-dss
It is good to validate the sshd config and check the modified option:
/usr/sbin/sshd -t
An example:
/usr/sbin/sshd -T | grep pubkeyacceptedkeytypes pubkeyacceptedkeytypes ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,sk-ssh-ed25519@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa
And restart sshd:
systemctl restart sshd.service
The OpenSSH client might need to modify as well to allow usage of DSA SSH key; either do:
- modify `ssh' command line option to include
-oPubkeyAcceptedAlgorithms=+ssh-dss
- modify either system or user's ssh_config(5) (see the man page for details), to include:
PubkeyAcceptedAlgorithms=+ssh-dss
Cause
Additional Information
- https://www.openssh.com/txt/release-7.0
- https://www.openssh.com/legacy.html
- https://en.wikipedia.org/wiki/Digital_Signature_Algorithm
- https://manpages.opensuse.org/Tumbleweed/openssh-server/sshd_config.5.en.html
- https://manpages.opensuse.org/Tumbleweed/openssh-clients/ssh_config.5.en.html
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000019837
- Creation Date: 19-Jan-2021
- Modified Date:21-Dec-2023
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com