Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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.
Bug 1747751 - [RFE] Ruby net-ssh doesn't support 'ed25519' ssh key type.
Summary: [RFE] Ruby net-ssh doesn't support 'ed25519' ssh key type.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Remote Execution
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: 6.10.0
Assignee: Adam Ruzicka
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-01 08:13 UTC by Hao Chang Yu
Modified: 2023-09-15 00:18 UTC (History)
15 users (show)

Fixed In Version: tfm-rubygem-foreman_remote_execution_core-1.4.6, libsodium-1.0.17-3, tfm-rubygem-rbnacl-4.0.2-2,satellite-6.10.0-2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:08:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
task-backtrace (15.13 KB, text/plain)
2021-06-16 13:14 UTC, Peter Ondrejka
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 27770 0 Normal Closed Ruby net-ssh doesn't support 'ed25519' ssh key type. 2021-07-20 16:42:13 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:09:04 UTC

Description Hao Chang Yu 2019-09-01 08:13:39 UTC
Description of problem:
I raised a bug 1747748 about remote execution job hangs when using unsupported ssh key type. This bugzilla is about adding support to 'ed25519' key by making the following gems as the dependencies for foreman remote execution plugin or for our net-ssh rpm.

------------------------------
/opt/theforeman/tfm/root/usr/share/gems/gems/net-ssh-4.0.1/lib/net/ssh/authentication/ed25519_loader.rb:19:in `raiseUnlessLoaded': unsupported key type `ssh-ed25519' (NotImplementedError)
net-ssh requires the following gems for ed25519 support:
 * rbnacl (>= 3.2, < 5.0)
 * rbnacl-libsodium, if your system doesn't have libsodium installed.
 * bcrypt_pbkdf (>= 1.0, < 2.0)
See https://github.com/net-ssh/net-ssh/issues/478 for more information
Gem::MissingSpecError : "Could not find 'rbnacl' (< 5.0, >= 3.2.0) among 202 total gem(s)
------------------------------

Due to several reasons net/ssh maintainers don't want to make these gems as the dependencies for net/ssh. See the following thread for more details.

https://github.com/net-ssh/net-ssh/issues/476

Full reproduced outputs:
su - -s /bin/bash foreman-proxy
scl enable tfm "ruby /tmp/ssh_cmd.rb my-target.example.com root 'sudo sh -c uptime'"
<snip>
D, [2019-09-01T17:30:15.600578 #25120] DEBUG -- net.ssh.authentication.session[a6c020]: trying publickey
Traceback (most recent call last):
	14: from /tmp/ssh_cmd.rb:28:in `<main>'
	13: from /opt/theforeman/tfm/root/usr/share/gems/gems/net-ssh-4.0.1/lib/net/ssh.rb:237:in `start'
	12: from /opt/theforeman/tfm/root/usr/share/gems/gems/net-ssh-4.0.1/lib/net/ssh/authentication/session.rb:66:in `authenticate'
	11: from /opt/theforeman/tfm/root/usr/share/gems/gems/net-ssh-4.0.1/lib/net/ssh/authentication/session.rb:66:in `each'
	10: from /opt/theforeman/tfm/root/usr/share/gems/gems/net-ssh-4.0.1/lib/net/ssh/authentication/session.rb:80:in `block in authenticate'
	 9: from /opt/theforeman/tfm/root/usr/share/gems/gems/net-ssh-4.0.1/lib/net/ssh/authentication/methods/publickey.rb:19:in `authenticate'
	 8: from /opt/theforeman/tfm/root/usr/share/gems/gems/net-ssh-4.0.1/lib/net/ssh/authentication/key_manager.rb:101:in `each_identity'
	 7: from /opt/theforeman/tfm/root/usr/share/gems/gems/net-ssh-4.0.1/lib/net/ssh/authentication/key_manager.rb:217:in `load_identities'
	 6: from /opt/theforeman/tfm/root/usr/share/gems/gems/net-ssh-4.0.1/lib/net/ssh/authentication/key_manager.rb:217:in `map'
	 5: from /opt/theforeman/tfm/root/usr/share/gems/gems/net-ssh-4.0.1/lib/net/ssh/authentication/key_manager.rb:221:in `block in load_identities'
	 4: from /opt/theforeman/tfm/root/usr/share/gems/gems/net-ssh-4.0.1/lib/net/ssh/key_factory.rb:84:in `load_public_key'
	 3: from /opt/theforeman/tfm/root/usr/share/gems/gems/net-ssh-4.0.1/lib/net/ssh/key_factory.rb:103:in `load_data_public_key'
	 2: from /opt/theforeman/tfm/root/usr/share/gems/gems/net-ssh-4.0.1/lib/net/ssh/buffer.rb:242:in `read_key'
	 1: from /opt/theforeman/tfm/root/usr/share/gems/gems/net-ssh-4.0.1/lib/net/ssh/buffer.rb:275:in `read_keyblob'
/opt/theforeman/tfm/root/usr/share/gems/gems/net-ssh-4.0.1/lib/net/ssh/authentication/ed25519_loader.rb:19:in `raiseUnlessLoaded': unsupported key type `ssh-ed25519' (NotImplementedError)
net-ssh requires the following gems for ed25519 support:
 * rbnacl (>= 3.2, < 5.0)
 * rbnacl-libsodium, if your system doesn't have libsodium installed.
 * bcrypt_pbkdf (>= 1.0, < 2.0)
See https://github.com/net-ssh/net-ssh/issues/478 for more information
Gem::MissingSpecError : "Could not find 'rbnacl' (< 5.0, >= 3.2.0) among 202 total gem(s)


Version-Release number of selected component (if applicable):
6.5

Comment 3 Adam Ruzicka 2019-09-03 12:56:56 UTC
Created redmine issue https://projects.theforeman.org/issues/27770 from this bug

Comment 5 Bryan Kearney 2021-05-15 22:36:14 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/27770 has been resolved.

Comment 8 Adam Ruzicka 2021-05-31 10:17:07 UTC
Not sure if the change got CP'd or what happened, but upstream release containing the fix just went out.

Comment 9 Peter Ondrejka 2021-06-16 13:13:13 UTC
Checked on Sat 6.10 sn 4, attempting to run a rex job using a ed25519 key failed with "Net::SSH::AuthenticationFailed" (task backtrace in attachment)

Verification steps for reference:
- cd /var/lib/foreman-proxy
- ssh-keygen -o -a 100 -t ed25519 -f ssh/id_ed25519 -C "foreman-proxy@hostname"
- in /etc/foreman-proxy/settings.d/remote_execution_ssh.yml set 
     :ssh_identity_key_file: /var/lib/foreman-proxy/ssh/id_ed25519
- restart services
- refresh capsule in sat ui capsule details
- on host:
     curl https://sat_hostname:9090/ssh/pubkey >> ~/.ssh/authorized_keys
- run rex job

packges:
tfm-rubygem-net-ssh-4.2.0-3.el7sat.noarch
tfm-rubygem-foreman_remote_execution_core-1.4.2-1.el7sat.noarch

(doublechecked I'm really on sn4, seems like the rex_core package version is lower than promised...)

Comment 10 Peter Ondrejka 2021-06-16 13:14:23 UTC
Created attachment 1791540 [details]
task-backtrace

Comment 11 Adam Ruzicka 2021-06-16 13:28:02 UTC
Could you bump log level to debug in /etc/smart_proxy_dynflow_core/settings.yml and ssh_log_level in /etc/foreman-proxy/settings.d/remote_execution_ssh.yml , restart services, run the job again and attach logs from /var/log/foreman-proxy/proxy.log?

Comment 12 Bryan Kearney 2021-07-09 12:01:09 UTC
Upstream bug assigned to aruzicka

Comment 14 Peter Ondrejka 2021-07-16 14:07:23 UTC
Still getting Net::SSH::AuthenticationFailed on Satellite 6.10 sn 9, attaching proxy.log

Comment 16 Peter Ondrejka 2021-07-23 14:23:12 UTC
Attempting to verify on Sat 6.10 snap 10, using steps from comment 9. The rex job remains hanging in pending state after setting the ed25519 key. Direct ssh connection from host to client via "ssh root@host -i id_ed25519" works. Nothing significant appears in the proxy log. 

Reproduction machine available upon ping.

Comment 18 Peter Ondrejka 2021-08-06 10:09:45 UTC
Checking on satellite 6.10 sn 12 with tfm-rubygem-foreman_remote_execution_core-1.4.6-1.el7sat.noarch, unfortunately I'm still getting to the infinite pending state when running rex job with ed25519 key

Comment 33 Peter Ondrejka 2021-10-21 13:36:19 UTC
Checked on Satellite 6.10 sn 24, the packages are present now and rex performs successfully with ed25519 key (steps from #comment 9). 

Unfortunately, there is a problem with global registration that does not honor the key setting in /etc/foreman-proxy/settings.d/remote_execution_ssh.yml when setting up remote execution. It always pulls id_rsa_foreman_proxy, so the user needs to do  curl https://sat_hostname:9090/ssh/pubkey >> ~/.ssh/authorized_keys manually to set up ed25519 rex.

Comment 34 Adam Ruzicka 2021-10-21 15:21:06 UTC
That's odd, it seems to work well on a fresh machine I just deployed.

Comment 35 Peter Ondrejka 2021-10-25 08:25:21 UTC
#33 was due to omitted feature refresh on capsule, moving to verified

Comment 38 errata-xmlrpc 2021-11-16 14:08:51 UTC
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 (Moderate: Satellite 6.10 Release), 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/RHSA-2021:4702

Comment 39 Red Hat Bugzilla 2023-09-15 00:18:29 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days


Note You need to log in before you can comment on or make changes to this bug.