-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] StrictHostKeyChecking=accept-new causes install failure on OpenSSH <7.6 #31
Comments
@nlf if you're looking at this repo &/or changing anything can you review this issue |
😞 i was operating under the assumption that a nearly 4 year old release of openssh was going to be a low enough bar that this would be reasonable, but it appears not if Amazon Linux doesn't have it. we'll revisit this and try to come up with another way. thanks for the report! |
One workaround for anyone else finding this: specify the GIT_SSH_COMMAND env var when calling npm, eg |
Even if this didn't error, it is still problematic as it downgrades ssh security by default. |
I am facing the same issue as well. What's the solution for this other than updating openssh version or using workaround? |
@nlf did you come up with something? |
This is a breaking change imho and should be communicated as such. What if no newer version of OpenSSH is available ? Will there be a working fallback ? |
@joshuawinsor Can you please elaborate on what security concerns may be caused, or any active issues that someone faced. As I am using GIT_SSH_COMMAND="ssh" npm ci as a workaround. |
the default ssh implementation is the following in order taking the first one that comes up commandline options This overrides all of that to use a weaker security model than the default (and you may not think it is that much weaker, but it is weaker otherwise ssh would set accept-new by default). The proper way to do this for gitlab (or whoever it is that isn't properly doing their ssh server farm to maintain an ssh host id) to fix their implementation. Until that point users should simply add that host to ~/.ssh/config to have StrictHostChecking accept-new Also there are systems that I have used that make it difficult to set environment variables on all my npm commands. Again this makes ssh ignore what you have set for StrictHostChecking in your .ssh/config |
Currently facing this issue. I've tried exporting GIT_SSH_COMMAND=ssh but it did not work. I am trying this on AWS ElasticBeanstalk (Node.js 16 running on 64bit Amazon Linux 2/5.5.3) which runs OpenSSH_7.4p1. Am I missing something? I set the environment variable using the export keyword within hook inside of .platform/hooks/prebuild. Is there a different way to do this? I also attempted to install the latest openssh using ebextensions but it complained that version 8 does not exist within the yum repos. Any help would be greatly appreciated |
Also facing this issue with the AWS shift from "Linux 1" to "Linux 2" in Elastic Beanstalk. AWS provides their own CVE updates to openssh, but they are still running a pretty old version of it in the "new" Linux 2 AMI:
This breaks eb deploys if you have a package.json with a git reference to a package that your own org is deploying. Other info about the AWS Linux 2 AMI:
|
Just in case anyone is still struggling with this bug, you can also use this line:
It worked perfectly for me on the company dev servers. Config:
|
We ran into this same issue with an Amazon Linux 2 EC2 instance, and we used this gist to update our OpenSSH version to 8.x: https://gist.github.com/roommen/18cd78d07b0fbc962de4e79c1d468f92 After updating, things worked again. |
https://issues.jenkins.io/browse/JENKINS-69149 Quote from the ticket:
|
As seen in the comments on npm/cli#3233 and #7, trying to install a git repository with the current npm CLI fails
when using OpenSSH <7.6 with the following:
While the change is in theory a good one (I was caught off guard with the old behavior when cloning a repository failed due to a missing host key), it creates issues in practice.
Proposals I've seen include:
ssh -V
) before attempting to use accept-newThe text was updated successfully, but these errors were encountered: