1
I am trying to access an Amazon EC2 instance via ssh from my linux-Ubuntu.
I already created the machine in the console of Amazon, I created a key pair , hence what I did (so I understood I had to do) on my pc, I went to the folder where downloaded the my-key-pair.pem
and from there I ran the command
chmod 400 my-key-pair.pem
afterward
ssh -i my-key-pair.pem [email protected]
and then gave me this mistake
Warning: Permanently added '51.207.86.54' (ECDSA) to the list of known hosts.
Permission denied (publickey).
I’m doing something wrong or anything from a beginner in this aws world.?
Good young man, I believe that this is not the right place for questions that are not relating to programming. Maybe you should modify it a little bit.
– noNihongo
So @Eduardobrj I imagine that here is actually a good place for this question, but anyway, it’s just a problem I’m having, but I keep looking elsewhere without problems. I don’t see much to change, in case you see free to edit. Valew and if you know something to help I appreciate.
– Marcelo Diniz
See if your IP is cleared to access the instance in the AWS security settings.
– Rodrigo Rigotti
Sorry, at no time I wanted to tell you "what to do", I am following the community that focuses on solving problems related to programming, I do not see SSH as programming (mainly key problem), but who am I to juggle. Sorry for any inconvenience. Good Luck.
– noNihongo
As answered by Bruno Reis, the error seems to be related to the user used in the "Ubuntu" connection, with the EC2 user, the user must be the same as AMI, otherwise you receive this error. You can try connecting using the following command
ssh -l USUARIO_DA_EC2 -i my-key-pair.pem ec2-51-207-86-54.sa-east-1.compute.amazonaws.com
– ooredroxoo