mssh -d -r eu-west-2 i-XXXXXXXXXXXXXXX
2021-07-24 19:15:58,821 - botocore.httpsession - DEBUG - Certificate path: /usr/local/lib/python3.9/site-packages/botocore/cacert.pem
2021-07-24 19:15:59,629 - botocore.parsers - DEBUG - Response headers: {'x-amzn-RequestId': 'cec3279a-c220-45b7-b99b-930c0a7a8fe0', 'Content-Type': 'application/x-amz-json-1.1', 'Content-Length': '67', 'Date': 'Sat, 24 Jul 2021 23:15:59 GMT'}
2021-07-24 19:15:59,629 - botocore.parsers - DEBUG - Response body:
b'{"RequestId":"cec3279a-c220-45b7-b99b-930c0a7a8fe0","Success":true}'
2021-07-24 19:15:59,629 - botocore.hooks - DEBUG - Event needs-retry.ec2-instance-connect.SendSSHPublicKey: calling handler <botocore.retryhandler.RetryHandler object at 0x1139e8e80>
2021-07-24 19:15:59,629 - botocore.retryhandler - DEBUG - No retry needed.
2021-07-24 19:15:59,631 - EC2InstanceConnect - DEBUG - Successfully pushed the public key to i-XXXXXXXXXXXXXXX
2021-07-24 19:15:59,632 - EC2InstanceConnect - DEBUG - Generated command: ssh -o "IdentitiesOnly=yes" -i /var/folders/vk/11pm_tqj4llb5h4j36cqp7480000gn/T/tmpsb6y5b8t [email protected]
[email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
2021-07-24 19:16:03,205 - EC2InstanceConnect - DEBUG - Deleting the private key file: /var/folders/vk/11pm_tqj4llb5h4j36cqp7480000gn/T/tmpsb6y5b8t
You can see the final lines suggest the temporary key was successfully pushed, yet get permission denied after that. The time sync solution reported by others did not solve my problem.
This is rather strange since I am able to mssh into other instances, all of which are Amazon Linux 2. I am doing all of this from a mac.
Any help would be really appreciated :)