uselagoon / lagoon-cli

A CLI for Lagoon - Docker Build and Deploy System for Kubernetes
https://uselagoon.github.io/lagoon-cli
MIT License
24 stars 15 forks source link

Not able to specify a specific ssh key from ssh-agent #354

Closed rocketeerbkw closed 3 months ago

rocketeerbkw commented 3 months ago

Describe the bug The golang SSH handling in the cli will iterate over all of the keys in the system ssh-agent, but the order of the keys is non-deterministic. In the case where a user has more than six SSH keys, it's possible that the correct one is at the end of the list and the max auth attempts is exceeded.

The error is error: maximum authentication attempts exceeded.

To Reproduce Steps to reproduce the behavior:

  1. Add more than six keys to your ssh-agent
  2. Make sure the one used for lagoon is "last" in the list
  3. Try to ssh into a lagoon environment
  4. See error

Expected behavior I can have as many SSH keys as I want, and I can use an ssh-agent to manage my passphrase settings.

Additional context More discussion and background in https://github.com/uselagoon/lagoon/pull/3739.

Some ideas to fix in the cli are:

shreddedbacon commented 3 months ago

I've got a POC for this that sort of works, but it will require some changes to configuration which is a bit annoying