Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh: Use ed25519 algorithm instead ECDSA #4304

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

praveenkumar
Copy link
Member

@praveenkumar praveenkumar commented Aug 7, 2024

Key generated using ecdsa algorithm is causing issue for podman remote
connection on podman desktop side because the library they consume
doesn't have support for this algorithm. This PR is switching the ecdsa
to ed25519 which is supported by the library consumed in podman desktop.

[0] podman-desktop/podman-desktop#8351
[1] mscdex/ssh2#1375

how to test

  • Use artifact from this PR to install crc (windows and mac)
  • Install the podman-desktop
  • No need to start podman machine or even enable the openshift-local plugin
  • from the PD, Setting => preference => Extension: podman => Enable the Remote
  • start crc with microshift preset
$ podman system connection add crc-root --identity "C:\Users\<username>\.crc\machines\crc\id_ed25519"  "ssh://[email protected]:2222/run/podman/podman.sock"
  • on the PD check if images and pods are now listed.

Key generated using ecdsa algorithm is causing issue for podman remote
connection on podman desktop side because the library they consume
doesn't have support for this algorithm. This PR is switching the ecdsa
to ed25519 with openssh type which is supported by the library consumed
in podman desktop.

[0] podman-desktop/podman-desktop#8351
[1] mscdex/ssh2#1375
…mpatibility

We were using RSA Algo long time ago and this function is used to
provide a backward compatibility for that version of crc but since in
previous commit we have updated the ssh algo from ecdsa to ed25519, to
have the backward compatibility for some released version we are
renaming this function.
@praveenkumar
Copy link
Member Author

/retest

Copy link

openshift-ci bot commented Aug 8, 2024

@praveenkumar: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/images 8794f8a link true /test images
ci/prow/e2e-microshift-crc 8794f8a link true /test e2e-microshift-crc
ci/prow/e2e-crc 8794f8a link true /test e2e-crc
ci/prow/integration-crc 8794f8a link true /test integration-crc
ci/prow/security 8794f8a link false /test security

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@vyasgun
Copy link
Contributor

vyasgun commented Aug 13, 2024

Can you list the testing steps in the PR description?

Copy link

openshift-ci bot commented Aug 13, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anjannath

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@praveenkumar
Copy link
Member Author

Can you list the testing steps in the PR description?

podman-desktop/podman-desktop#8351 have steps around how it can be tested, I also added the steps here.

@anjannath
Copy link
Member

Can you list the testing steps in the PR description?

What i did to test was, ensure running crc start was successful with the 4.16.4 bundle,

then verified i can ssh into the crc VM using the new ed25519 key using:

$ ssh -i ~/.crc/machines/crc/id_ed25519 -p 2222 -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no core@localhost`

@vyasgun
Copy link
Contributor

vyasgun commented Aug 14, 2024

Thanks @praveenkumar and @anjannath . I tested and it works for me too via terminal but not through PD (I can't see any id_ed25519 file in the crc directory). Also, the step to add podman system connection is only required for Windows, right? I am on MacBook.

Logs:

gvyas-mac:crc gvyas$ ~/.crc/bin/crc version
CRC version: 2.40.0+a14925
OpenShift version: 4.16.4
MicroShift version: 4.16.4

gvyas-mac:~ gvyas$ tail -f ~/.crc/crc.log
time="2024-08-14T13:14:06+05:30" level=info msg="Checking if /Users/gvyas/.crc/cache/crc_microshift_vfkit_4.16.4_amd64.crcbundle exists"
time="2024-08-14T13:14:06+05:30" level=debug msg="/Users/gvyas/.crc/cache/crc_microshift_vfkit_4.16.4_amd64.crcbundle exists"
time="2024-08-14T13:14:06+05:30" level=info msg="Checking if old launchd config for tray and/or daemon exists"
time="2024-08-14T13:14:06+05:30" level=info msg="Checking if crc daemon plist file is present and loaded"
time="2024-08-14T13:14:06+05:30" level=debug msg="Running 'bash -c launchctl list | grep com.redhat.crc.daemon | awk '{print $1}''"
time="2024-08-14T13:14:06+05:30" level=info msg="Checking SSH port availability"
time="2024-08-14T13:14:06+05:30" level=debug msg="CRC version: 2.40.0+a14925\n"
time="2024-08-14T13:14:06+05:30" level=debug msg="OpenShift version: 4.16.4\n"
time="2024-08-14T13:14:06+05:30" level=debug msg="MicroShift version: 4.16.4\n"
time="2024-08-14T13:14:06+05:30" level=debug msg="Running 'crc config get'"
time="2024-08-14T13:15:21+05:30" level=debug msg="CRC version: 2.40.0+a14925\n"
time="2024-08-14T13:15:21+05:30" level=debug msg="OpenShift version: 4.16.4\n"
time="2024-08-14T13:15:21+05:30" level=debug msg="MicroShift version: 4.16.4\n"
time="2024-08-14T13:15:21+05:30" level=debug msg="Running 'crc version'"
time="2024-08-14T13:15:22+05:30" level=debug msg="No new version available. The latest version is 2.40.0"

Podman Desktop version (v1.12.0)

image

@anjannath
Copy link
Member

there's a typo in this command:

$ podman system connection add crc-root --identity "C:\Users<username>.crc\machines\crc\id_ecdsa" "ssh://[email protected]:2222/run/podman/podman.sock"

the path to the ssh key should use the ed_25519 key so C:\Users\<username>\.crc\machines\crc\id_ed25519

@praveenkumar praveenkumar merged commit ee36371 into crc-org:main Aug 20, 2024
19 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants