How to ssh into EC2 instance without PEM key

0 votes
I can access with the PEM key but after adding my local machine's public key to the authorized keys, I cannot login without the pem key. It just tells me "Permission denied (publickey). Can someone help me with this?
Mar 13, 2019 in AWS by Shalil
1,702 views

1 answer to this question.

0 votes

You need ssh-agent to supply your PEM file during ssh.

First, start the ssh-agent:

eval `ssh-agent -s`

Then add you PEM key to agent

ssh-add <pem-key>

Now you can ssh without supplying PEM.

this worked for me, hope this works for you aswell.

answered Mar 13, 2019 by trisha

Related Questions In AWS

0 votes
2 answers

I lost my .pem file now how to login into EC2 instance?

Hi, If you forget your .pem file then ...READ MORE

answered Sep 30, 2020 in AWS by MD
• 95,460 points
2,616 views
0 votes
3 answers
0 votes
2 answers

How to recover lost private key of an EC2 instance?

I'm afraid it's not possible When you launch ...READ MORE

answered Sep 25, 2018 in AWS by Archana
• 4,170 points
22,376 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP