Closed brennentsmith closed 4 years ago
This really would be best to add. Otherwise when you get user reports of failures you can't know that it even failed with the key you're generating. I will file a bug upstream in Ubuntu (my OS of choice) to consider trying explicit keys before keys from the agent, but the cli should add '-o IdentitiesOnly=yes' to ensure the ephemeral key (and only the ephemeral key) is used for the connection.
Thanks for the feedback!
We are working on explicitly specifying IdentitiesOnly=yes
when calling ssh, however we are still discussing internally on potential side-effects of this approach.
For a quick workaround - as mentioned in #15, you can add extra parameters and mssh will pass it to ssh, e.g. mssh ec2-user@i-1234567890abcd -o "IdentitiesOnly=yes"
Mssh only uses the
-i
flag, which instructs SSH to use the SSH key generated by the command. However, this still includes keys within the SSH agent and the included key is appended to the end of the list. This ends in a case such as:The key defined with the -i flag is added to the list last. This causes failures to login as SSH is configured on AMZN Linux to drop a connection after 5 failures.
The SSH option
IdentitiesOnly=yes
ensures that only the files defined in the ssh config file and the explicit identity are used.This ensures that the mssh command uses the mssh generated key and does not fail.