segmentio / stack

A set of Terraform modules for configuring production infrastructure with AWS
https://open.segment.com
MIT License
2.1k stars 422 forks source link

ssh from bastion not working #109

Open mbjerkness opened 7 years ago

mbjerkness commented 7 years ago

When I am either trying to ssh through the bastion or ssh to the bastion and then ssh to one of my internal servers, I am continually getting Host key verification failed.

$ ssh -i ~/.ssh/key-pair.pem ubuntu@EXTERNAL_IP ssh ubuntu@INTERNAL_IP The authenticity of host 'EXTERNAL_IP (EXTERNAL_IP)' can't be established. ECDSA key fingerprint is SHA256:SHA_FINGER_PRINT_HERE. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'EXTERNAL_IP' (ECDSA) to the list of known hosts. Pseudo-terminal will not be allocated because stdin is not a terminal. Host key verification failed.

mbjerkness commented 7 years ago

I was able to manually FTP the public key up to the bastion host and then I was able to ssh into the internal servers, is this expected?

Brzhk commented 7 years ago

@mbjerkness see https://github.com/BrzhkDev/stack-jenkins/tree/master/ssh_helper Can't answer for the devs, but there seem to be an incomplete provisioning of the ~/.ssh/config file in the bastion module. Be careful with my module on the way to create public/private ssh keys. It also only adds the bastion in your local known_hosts file, but not the host instances in the bastion's.