Skip to content
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

Avoid interactive mess with SSH connecting to local docker environments #126

Open
jameswilson opened this issue Jun 2, 2016 · 1 comment

Comments

@jameswilson
Copy link
Contributor

jameswilson commented Jun 2, 2016

I have some hooks defined in my .terra.yml file, and I'm getting an interactive prompt during the initial install/build step.

$ drush @terra.so.local4 site-install commerce_base --account-pass=admin -y
The authenticity of host '[makak.local]:32799 ([192.168.1.10]:32799)' can't be established.
ECDSA key fingerprint is SHA256:TMEHrEU/pDn8qu25BpJv8NJqv5qMTIy60aAK2RdPg8o.
Are you sure you want to continue connecting (yes/no)? yes

There's a couple ways to prevent this from happening.

  1. Add some lines to ~/.ssh/config
Host 192.168.1.*
   StrictHostKeyChecking no
   UserKnownHostsFile=/dev/null
  1. Add some additional ssh_options when terra creates the drush aliases:
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null

From a usability perspective, 2 is clearly a better solution. But these options do have security implications. We'd need add these options for local docker environments only, because that warning is something you don't want to miss for remote URLs.

@jameswilson jameswilson changed the title Avoid interactive mess with SSH connecting to localhost Avoid interactive mess with SSH connecting to local docker environments Jun 2, 2016
@jonpugh
Copy link
Member

jonpugh commented Jun 2, 2016

Great writeup...

I think 2. is a good option for now. We should consider this as a great use case as we get more work done incorporating terra/core https://github.com/terra-ops/TerraCore/tree/master/src/Environment

Note that the "Factory" class is what I plan on refactoring into a "Driver" type class.

Once we have some kind of EnvironmentDriverDockerLocal class, these SSH options should be included just in that driver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants