fix: default to accepting new ssh host key fingerprints #7
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.
currently, if a user tries to use npm to install a git repository over ssh from a host that does not already exist in their
~/.ssh/known_hosts
a prompt is half displayed and the install appears to hang. pressing enter when this happens does unblock the install, but the behavior is super strange.this change requires a git version > 2.3 and an openssh version > 7.6 but is a reasonably safe default as it will accept new host fingerprints without prompting, but hosts that exist in your
~/.ssh/known_hosts
will be verified and fail if they mismatch.this default behavior can be overridden by either of
core.sshCommand
in your~/.gitconfig
GIT_SSH_COMMAND
I'll see if I can get an installation of something up and running with an older openssh to see how it's handled if the
accept-new
value isn't supported. older versions of git aren't a concern since they would simply ignore the env var and maintain the current behavior.References
Related to npm/cli#2741