Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
If I configure the ssh client to use host-based authentication with
ssh-keysign, it seems to be unable to use the rsa key and gives a fairly
incomprehensible error message saying:
ssh-keysign: sshkey_sign failed: error in libcrypto
ssh_keysign: no reply
Other key types like ecdsa seem to work OK. Was ssh-rsa key support disabled?
If so, that should be documented more clearly. Ideally, there would be a
clearer error message.
Version-Release number of selected component (if applicable):
openssh-8.7p1-8.el9
How reproducible:
always
Steps to Reproduce:
1. In a freshly installed CentOS Stream 9 qemu kvm, create /etc/ssh/sshd_config.d/99-local.conf with these contents:
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostbasedAuthentication yes
PasswordAuthentication no
Then create /etc/ssh/ssh_config.d/99-local.conf with these contents:
HostbasedAuthentication yes
EnableSSHKeysign yes
2. systemctl restart sshd
3. ssh -n localhost uptime
Actual results:
[root@localhost ssh]# ssh -n localhost uptime
ssh-keysign: sshkey_sign failed: error in libcrypto
ssh_keysign: no reply
sign using hostkey ssh-rsa SHA256:RUgzE2VqS2tcUzf1UM+x6UQX2GzQF25mL+4HPn+lScU failed
root@localhost: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,hostbased).
Expected results:
Either accept the rsa key or give a clearer error message.
Additional info:
With -v flags, you can see what's going on:
[root@localhost ssh]# ssh -v -n localhost uptime |& egrep 'hostbased|keysign'
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,hostbased
debug1: Next authentication method: hostbased
debug1: userauth_hostbased: trying hostkey ssh-ed25519 SHA256:u1vXVwHOTDXzgvJ419yue2in9fqtxxJw2lVJJu8sARI
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,hostbased
debug1: userauth_hostbased: trying hostkey ecdsa-sha2-nistp256 SHA256:R1JJaMNtqtfTqG/cb7neXwjw7q277TruFudn2HE9oa8
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,hostbased
debug1: userauth_hostbased: trying hostkey ssh-rsa SHA256:RUgzE2VqS2tcUzf1UM+x6UQX2GzQF25mL+4HPn+lScU
ssh-keysign: sshkey_sign failed: error in libcrypto
ssh_keysign: no reply
root@localhost: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,hostbased).
It looks like ssh_keysign is able to use the ecdsa and ed25519 keys, but it chockes on the ssh-rsa key. I can understand that maybe ssh-rsa was disabled for security reasons, but there should be a clearer error message explaining what's going on.
Also, if ssh-rsa host key types are not supported, then why is the key generated by sshd-keygen.target?
[root@localhost ssh]# cat /usr/lib/systemd/system/sshd-keygen.target
[Unit]
Wants=sshd-keygen
Wants=sshd-keygen
Wants=sshd-keygen
PartOf=sshd.service
Just remove "rsa" if it is no longer supported.
RSA is still supported, but ssh-rsa signatures using SHA1 are no longer supported. What is the other system you are using? Does it support RFC 8332 [1]? Does it work with crypto policies set to legacy or DEFAULT:SHA1?
[1] https://datatracker.ietf.org/doc/html/rfc8332
Comment 3Dmitry Belyavskiy
2022-05-23 09:17:18 UTC
Reopening. Indeed, this is a different issue than the bug #2068423 as this involves ssh-keysign, which ignores SHA2 in OpenSSH 8.7p1 version.
This should be fixed in upstream commit 7aa7b096cf2bafe2777085abdeed5ce00581f641 if I am right.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (openssh bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2022:8375