change: ssh host key verification prompts #370
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
General Checklist
The go knownhosts implementation doesn't prompt for host keys if they're unknown.
The lagoon-cli
ssh
command previously just ignored host keys entirely. With the introduction of thelogs
support, this command checked host keys.If a user had not previously connected to the ssh host before via ssh directly to accept the host key, then the command would return an error with
knownhosts: key is unknown
. With no way to proceed or accept the host key via lagoon-cli.This implements similar logic that ssh uses with StrictHostKeyChecking, with
accept-new
andno
.accept-new
is the default, and will just accept the host key and add it to known hosts, it will still check if the host key has changed though and present an error if it detects this.no
will just ignore the any host key checkingUsers that use lagoon-cli in automation, if you encounter issues with the host key checks, you can add the flag
--strict-host-key-checking no
to ignore it, or set the the feature flag as belowor add the line
stricthostkeychecking: no
to your lagoon-cli config.lagoon.yml
file.