vatertime / minecraft-spot-pricing

Cloudformation template to deploy a Minecraft server
MIT License
141 stars 85 forks source link

Cannot connect to ec2 instance using key file "Permission denied (publickey,gssapi-keyex,gssapi-with-mic)." #23

Open h3llo-wor1d opened 2 years ago

h3llo-wor1d commented 2 years ago

Not sure what is causing this error, I have the correct key file installed, but I can't even use the built-in AWS remote connect to see if I can fix it, so this is like really annoying and it's giving me a headache.

conrad760 commented 2 years ago

if you have console access you can check if the key file is part of the ec2 you are trying to connect to. If it is not but you have updated the cloudformation script you can just set the desired count to 0 then back to 1 and kick off a new ec2 with the key file.

jeffzys8 commented 2 years ago

Hey @willow-rubenstein I also encountered this issue. I tried to update the stack with a newly created SSH key pair after the stack was up. It seems I need to bind the key pair when the EC2 instance starts. I took the dumb move -- delete the whole stack and start a new one, but this time input the key pair before it was up -- and it worked. Maybe there's better way..