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

k0sctl doesn't read/understand ~/.ssh/config with relation to ssh-agent keys #422

Closed
warthog9 opened this issue Nov 2, 2022 · 3 comments · Fixed by k0sproject/rig#73 or #426
Closed
Labels
enhancement New feature or request

Comments

@warthog9
Copy link

warthog9 commented Nov 2, 2022

Situation: I use individual ssh keys, along with openssh's ssh agent, to deal with connecting to the respective hosts. I can get k0sctl to talk to the agent, however since k0sctl doesn't know about the information in the config file it reads in hundreds of ssh keys, tries them, and ultimately fails because it can't get to the right key.

A work arounds would be to only use a single key across the cluster (arguably not ideal but would work) and load a specific ssh-agent for using k0sctl. However being able to specify the agent key to use would be preferable. I thought I had this working before by setting keyPath, however that seems to (currently anyway) just cycle trying to unlock the encrypted keys and failing (not sure why it attempts to do that 60 times, I suspect that would not change and could be short circuited as well).

I'd propose adding something like agent: to keyPath, but really any way to indicate to the connection to not only explicitly use the agent, but which key in the agent to use would be perfect.

@kke kke added the enhancement New feature or request label Nov 3, 2022
@kke
Copy link
Contributor

kke commented Nov 3, 2022

It needs to try to sign the key using the agent first, if that works, use it, if the key path was the default, add a fall back to try all agent keys.

Also, it needs to try to get a default keypath from ssh_config before selecting ~/.ssh/id_rsa.

@kke
Copy link
Contributor

kke commented Nov 17, 2022

Hi, could you check with 0.15.0-rc.1 if it now works as expected?

See k0sproject/rig#73 and k0sproject/rig#75 for more details on the changes

Doesn't address the retrying, that will require a bit of error handling redesign (edit, now done in #427)

@kke kke reopened this Nov 17, 2022
@kke
Copy link
Contributor

kke commented Dec 30, 2022

I assume it was fixed.

@kke kke closed this as completed Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants