Bug 2106556
| Summary: | sudo failed publickey authentication with pam_ssh_agent_auth | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | quanm_qiu |
| Component: | openssh | Assignee: | Dmitry Belyavskiy <dbelyavs> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | BaseOS QE Security Team <qe-baseos-security> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 9.0 | CC: | jjelen, mhavrila, pbrezina, redhat-bugzilla |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-11-14 08:21:19 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
quanm_qiu
2022-07-13 01:47:44 UTC
This PAM module is provided by openssh so I'm changing the ownership. I'm running the same pam/sudo/authorizied_keys configuration (through ansible) on C7, C8S, C9S and Fedora. It works on all of them, except on C9S. I've raised an issue upstream as well (https://github.com/jbeverly/pam_ssh_agent_auth/issues/39) but given that this part of the code is being patched it might be a RHEL specific issue. It may be a duplicate of rhbz#2070113 If so, it's fixed recently That looks like it could be related, although I'm not getting any errors on the ssh-agent side (a F35 system) that I can see. Could you please confirm that the LEGACY or DEFAULT:SHA1 crypto policy resolves the problem? If so, it is a duplicate of rhbz#2070113 with high probability and will be fixed in 9.1 Reboot after run command update-crypto-policies --set DEFAULT:SHA1, the problem disappeared. But my pubkey format is SHA256:xxx. It has nothing to do with SHA1. (In reply to Dmitry Belyavskiy from comment #5) > Could you please confirm that the LEGACY or DEFAULT:SHA1 crypto policy > resolves the problem? If so, it is a duplicate of rhbz#2070113 with high > probability and will be fixed in 9.1 The problem is that SHA1 has is signed to prove the ownership of RSA key. Patch introduced to fix rhbz#2070113 explicitly tries sha256 for RSA keys. Another problem also disappeared after running update-crypto-policies --set DEFAULT:SHA1 in RHEL 9.0. I'm trying to setup a SSH hostbased authentication cluster with RHEL 9.0. Passwordless login between nodes always failed: ``` debug3: authmethod_lookup hostbased debug3: remaining preferred: publickey,keyboard-interactive,password debug3: authmethod_is_enabled hostbased debug1: Next authentication method: hostbased debug3: userauth_hostbased: trying key type ssh-ed25519 debug1: userauth_hostbased: trying hostkey ssh-ed25519 SHA256:xxxxxxx debug2: userauth_hostbased: chost node01. debug3: ssh_msg_send: type 2 debug3: ssh_msg_recv entering debug3: ssh_keysign: [child] pid=3040, exec /usr/libexec/openssh/ssh-keysign debug3: send packet: type 50 debug2: we sent a hostbased packet, wait for reply debug3: receive packet: type 51 debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password,hostbased debug3: userauth_hostbased: trying key type ssh-ed25519 debug3: userauth_hostbased: trying key type ecdsa-sha2-nistp256 debug1: userauth_hostbased: trying hostkey ecdsa-sha2-nistp256 SHA256:xxxxxxx debug2: userauth_hostbased: chost node01. debug3: ssh_msg_send: type 2 debug3: ssh_msg_recv entering debug3: ssh_keysign: [child] pid=3041, exec /usr/libexec/openssh/ssh-keysign debug3: send packet: type 50 debug2: we sent a hostbased packet, wait for reply debug3: receive packet: type 51 debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password,hostbased debug3: userauth_hostbased: trying key type ssh-rsa debug1: userauth_hostbased: trying hostkey ssh-rsa SHA256:xxxxxxx debug2: userauth_hostbased: chost node01. debug3: ssh_msg_send: type 2 debug3: ssh_msg_recv entering debug3: ssh_keysign: [child] pid=3042, exec /usr/libexec/openssh/ssh-keysign ssh-keysign: sshkey_sign failed: error in libcrypto ssh_keysign: no reply sign using hostkey ssh-rsa SHA256:xxxxxxx failed debug2: we did not send a packet, disable method debug3: authmethod_lookup publickey ``` After running update-crypto-policies --set DEFAULT:SHA1, Passwordless login between nodes working too: ``` debug3: authmethod_lookup hostbased debug3: remaining preferred: publickey,keyboard-interactive,password debug3: authmethod_is_enabled hostbased debug1: Next authentication method: hostbased debug3: userauth_hostbased: trying key type ssh-ed25519 debug1: userauth_hostbased: trying hostkey ssh-ed25519 SHA256:xxxxxxx debug2: userauth_hostbased: chost node01. debug3: ssh_msg_send: type 2 debug3: ssh_msg_recv entering debug3: ssh_keysign: [child] pid=1628, exec /usr/libexec/openssh/ssh-keysign debug3: send packet: type 50 debug2: we sent a hostbased packet, wait for reply debug3: receive packet: type 51 debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password,hostbased debug3: userauth_hostbased: trying key type ssh-ed25519 debug3: userauth_hostbased: trying key type ecdsa-sha2-nistp256 debug1: userauth_hostbased: trying hostkey ecdsa-sha2-nistp256 SHA256:xxxxxxx debug2: userauth_hostbased: chost node01. debug3: ssh_msg_send: type 2 debug3: ssh_msg_recv entering debug3: ssh_keysign: [child] pid=1629, exec /usr/libexec/openssh/ssh-keysign debug3: send packet: type 50 debug2: we sent a hostbased packet, wait for reply debug3: receive packet: type 51 debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password,hostbased debug3: userauth_hostbased: trying key type ssh-rsa debug1: userauth_hostbased: trying hostkey ssh-rsa SHA256:xxxxxxx debug2: userauth_hostbased: chost node01. debug3: ssh_msg_send: type 2 debug3: ssh_msg_recv entering debug3: ssh_keysign: [child] pid=1630, exec /usr/libexec/openssh/ssh-keysign debug3: send packet: type 50 debug2: we sent a hostbased packet, wait for reply debug3: receive packet: type 52 Authenticated to node02 ([192.168.1.2]:22) using "hostbased". debug1: pkcs11_del_provider: called, provider_id = (null) debug1: channel 0: new [client-session] debug3: ssh_session2_open: channel_new: 0 debug2: channel 0: send open debug3: send packet: type 90 debug1: Requesting no-more-sessions debug3: send packet: type 80 debug1: Entering interactive session. debug1: pledge: network debug3: receive packet: type 80 debug1: client_input_global_request: rtype hostkeys-00 want_reply 0 debug3: receive packet: type 4 debug1: Remote: Accepted for node01 [192.168.1.1] by /etc/ssh/shosts.equiv. debug3: receive packet: type 4 debug1: Remote: Accepted for node01 [192.168.1.1] by /etc/ssh/shosts.equiv. debug3: receive packet: type 4 debug1: Remote: Accepted for node01 [192.168.1.1] by /etc/ssh/shosts.equiv. debug3: receive packet: type 91 debug2: channel_input_open_confirmation: channel 0: callback start debug2: fd 3 setting TCP_NODELAY debug3: set_sock_tos: set socket 3 IP_TOS 0x48 debug2: client_session2_setup: id 0 debug2: channel 0: request pty-req confirm 1 debug3: send packet: type 98 debug2: channel 0: request shell confirm 1 debug3: send packet: type 98 debug2: channel_input_open_confirmation: channel 0: callback done debug2: channel 0: open confirm rwindow 0 rmax 32768 debug3: receive packet: type 99 debug2: channel_input_status_confirm: type 99 id 0 debug2: PTY allocation request accepted on channel 0 debug2: channel 0: rcvd adjust 2097152 debug3: receive packet: type 99 debug2: channel_input_status_confirm: type 99 id 0 debug2: shell request accepted on channel 0 ``` (In reply to quanm_qiu from comment #6) > Reboot after run command update-crypto-policies --set DEFAULT:SHA1, the > problem disappeared. > > But my pubkey format is SHA256:xxx. It has nothing to do with SHA1. This is just fingerprint format. It does not say anything about signature digest. It is visible only in the debug logs. > I'm trying to setup a SSH hostbased authentication cluster with RHEL 9.0. Passwordless login between nodes always failed: I think this is a bug #2088916 which should be fixed also with the recent build in centos9stream (-12.el9). Can you check? I believe both of described issues are fixed in RHEL-9.1. Could you please confirm it so we can close this bug? Regards, Marek Thanks. The problems disappeared in 9.1 (In reply to Marek Havrila from comment #10) > I believe both of described issues are fixed in RHEL-9.1. Could you please > confirm it so we can close this bug? > > Regards, > Marek Thank you for confirmation! Can confirm that pam_ssh_agent_auth-0.10.4-5.24.el9.x86_64 on c9s no longer requires enabling SHA1 |