Skip to content

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

@jameswilson

Description

@jameswilson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions