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,077 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,340 points
673 views
0 votes
3 answers
0 votes
2 answers

How to recover lost private key of an EC2 instance?

You can replace the new key using ...READ MORE

answered Nov 17, 2021 in AWS by anonymous
10,689 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Using Shapely on AWS Lambda with Python 3

For some reason, the pip install of ...READ MORE

answered Oct 8, 2018 in AWS by Priyaj
• 58,060 points
1,459 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP