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 12, 2019 in AWS by Shalil
624 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 12, 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 in AWS by MD
• 78,990 points
73 views
0 votes
3 answers
0 votes
1 answer

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,150 points
4,428 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