nchammas / flintrock

A command-line tool for launching Apache Spark clusters.
Apache License 2.0
637 stars 116 forks source link

SSHing into an instance with the wrong username results in a SSHException #207

Closed ktdrv closed 7 years ago

ktdrv commented 7 years ago

Launching a new cluster with the wrong username set by the --ec2-user option fails with a seemingly-unrelated paramiko.ssh_exception.SSHException: not a valid EC private key file error.

This because key handling in Paramiko is terribad (not my words): paramiko/paramiko#387.

We can probably safely catch this particular error and raise a more informative one because EC2 key-based auth doesn't even work with ECDSA keys.

Steps to replicate: flintrock launch --ec2-ami=<Amazon Linux AMI ID> --ec2-user=theboss cluster-mcclusterface

nchammas commented 7 years ago

Duplicate of #130. Duplicate of #171.

I'll submit a PR for this and ask you to test it, @ktdrv, if you don't mind. I get a different error than you when I put in the wrong username (protocol banner error), but perhaps I can find a solution that gives the correct hint for both of us.