Closed Programmer-yar closed 1 year ago
Typically this issue occurs when you run the same EC2 instance from another machine or under another local user.
When you start an instance with your spotty.yaml
for the first time:
spotty.yaml
)~/.spotty/keys/
).Then, if you try to start an instance using the same spotty.yaml
, but from another machine or under another user:
As a result, if you will try to run an instance from the previous machine or user, it won't work because that user has the old private key that doesn't match the public key in AWS.
I guess, it's the same in your case but with IAM users. If you tried to run an instance using the second IAM user, Spotty hasn't found the EC2 Key Pair there and overwrote your local private key, so it doesn't work with the EC2 Key Pair from the previous account anymore. Just remove either EC2 Key Pair in your AWS account or your local private key in ~/.spotty/keys/
directory and it should work.
Yes, you are right This was the case actually. Sorry, I forgot to update the status on this issue I am very grateful to you @apls777
Don't use @Programmer-yar It's a scammer
@apls777 Ahmad is not a solo dev. He didn't pay me.
I have been launching instances on AWS using spotty Previously, I have been able to ssh into instances using spotty. But I am getting the error:
Permission denied (publickey).
from yesterday. The only notable thing that I remember doing before I started getting this error was to switch IAM user from one AWS account to another in AWS CLI. I switched back to the IAM user I use to launch instances. Looking forward for guidance on this issue