Skip to content

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

@rocketeerbkw

Description

@rocketeerbkw

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 uselagoon/lagoon#3739.

Some ideas to fix in the cli are:

  • Use a go library to parse ~/.ssh/config
  • Add another config option to select a specific key from the ssh-agent
    • Or use the existing -i flag

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions