Describe the bug
The Lagoon CLI tool seems to make several assumptions about SSH keys. In several places, the existing code searches for exactly the string ~/.ssh/id_rsa, giving that type of private key special status. GitHub specifically recommends ed25519 keys and only suggests RSA on "legacy systems".
In PR #44, it was suggested by @smlx:
Honestly I think it would be fair to offload all key handling to the agent and not attempt to manually load SSH keyfiles at all. Best practice is to use an agent anyway, and that way any new SSH key formats are automatically handled going forward.
But I don't think this suggestion was implemented.
It would be much better if Lagoon CLI would read (and try) all available keys from ssh-add -L, rather than reading individual SSH keys.
To Reproduce
Steps to reproduce the behavior:
- Install
lagoon CLI normally.
- On an environment where
~/.lagoon.yml has not been modified to add an sshkey value, create a key at ~/.ssh/id_ed25519 with chmod 600. There should also not be a ~/.ssh/id_rsa file.
- Attempt to execute a lagoon command such as
lagoon whoami
- The command will return
Error: open /home/runner/.ssh/id_rsa: no such file or directory.
Expected behavior
The command should succeed using the available ~/.ssh/id_ed25519 key.
Desktop (please complete the following information):
Describe the bug
The Lagoon CLI tool seems to make several assumptions about SSH keys. In several places, the existing code searches for exactly the string
~/.ssh/id_rsa, giving that type of private key special status. GitHub specifically recommends ed25519 keys and only suggests RSA on "legacy systems".In PR #44, it was suggested by @smlx:
But I don't think this suggestion was implemented.
It would be much better if Lagoon CLI would read (and try) all available keys from
ssh-add -L, rather than reading individual SSH keys.To Reproduce
Steps to reproduce the behavior:
lagoonCLI normally.~/.lagoon.ymlhas not been modified to add ansshkeyvalue, create a key at~/.ssh/id_ed25519withchmod 600. There should also not be a~/.ssh/id_rsafile.lagoon whoamiError: open /home/runner/.ssh/id_rsa: no such file or directory.Expected behavior
The command should succeed using the available
~/.ssh/id_ed25519key.Desktop (please complete the following information):