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 in AWS by Shalil
71 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 by trisha

Related Questions In AWS

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,090 points
203 views
0 votes
1 answer
0 votes
1 answer

How to set up a SPF(Sender Policy Framework) for AWS EC2 instance?

Setting up a SPF record is pretty ...READ MORE

answered Aug 16, 2018 in AWS by Archana
• 4,090 points
188 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer