1
votes

I have a jenkins box, I have ssh in to it and from there I want to access one of the Ec2 instance in AWS, I tried ssh -i "mykeyname.pem" ec2-user@DNSname but It throws me an error "Permission denied (publickey,gssapi-keyex,gssapi-with-mic)". I have the PEM file of the EC2 instance I want to connect. But is there any way I can ssh in to the instance..?

1

1 Answers

0
votes

There are two possible reasons.

  1. Default user name is not "ec2-user"

    • Please check your using image "jenkins box".
    • If it doesn't use "ec2-user", change user name for ssh commands
  2. Your key-pair is incorrect

    • Once you created EC2 instance with correct key-pair, you could access EC2 instance with such commands
    • Please check your using key-pair name

FYI

Connecting to Your Linux Instance Using SSH