Skip to content

Commit

Permalink
EC2: disable strict host checking for SSH
Browse files Browse the repository at this point in the history
It's safe to assume the first connection to the host
returned by EC2 is safe, since noone will really check if IP
is withing amazon IP ranges

cc @edolstra @rbvermaa
  • Loading branch information
domenkozar committed Dec 6, 2016
1 parent 69e608a commit b104025
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nixops/backends/ec2.py
Expand Up @@ -182,7 +182,7 @@ def get_ssh_private_key_file(self):
def get_ssh_flags(self, *args, **kwargs):
file = self.get_ssh_private_key_file()
super_flags = super(EC2State, self).get_ssh_flags(*args, **kwargs)
return super_flags + (["-i", file] if file else [])
return super_flags + ["-o", "StrictHostKeyChecking=no"] + (["-i", file] if file else [])

def get_physical_spec(self):
block_device_mapping = {}
Expand Down

5 comments on commit b104025

@edolstra
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, why is this needed?

Strict host key checking should work fine because NixOps specifies the initial host key via the instance user data.

@domenkozar
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be it's broken now? I'm using nixopsUnstable and 17.03 as base image. So probably best to revert this and dig into why it's broken.

@edolstra
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I haven't seen any problems, but I haven't tried 17.03.

@domenkozar
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted in 5a9adc8

@ip1981
Copy link
Contributor

@ip1981 ip1981 commented on b104025 Mar 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see problems with nixpkgs 16.09 + nixops 1.5. In clean environment I get "Host key verification failed".

Please sign in to comment.