Permissions for 'key123.pem' are too open. It is required that your private key files are NOT accessible by others.

0 votes

Hi Guys, 

I am trying to do SSH in my instance. But it is showing me the below error. 

C:\>ssh -l ec2-user 13.126.141.194 -i key123.pem
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for 'key123.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "private-key.ppk": bad permissions
ec2-user 13.126.141.194: Permission denied (publickey).

How can I solve this error?

Jun 3 in AWS by akhtar
• 14,610 points
98 views

1 answer to this question.

0 votes

Hi@akhtar,

You got this error because you didn't set security for your key file. To avoid this error, you can follow the below given commands. Open power shell from your windows system and run all the given commands one by one.

$ $path=".\key.pem"
$icacls.exe $path /reset
$icacls.exe $path /inheritance:r
$icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"

Hope this will solve your error.

answered Jun 3 by MD
• 32,730 points

Related Questions In AWS

0 votes
1 answer

Error creating Key Pair: You are not authorized to perform this operation

Try adding AmazonEC2FullAccess policy. If you are not sure how ...READ MORE

answered Sep 19, 2018 in AWS by Priyaj
• 57,530 points
1,249 views
+5 votes
2 answers

What are the different job roles that one can get for AWS

If you have the AWS certification for ...READ MORE

answered Sep 21, 2018 in AWS by Priyaj
• 57,530 points
120 views
0 votes
1 answer

Is there any certification required for an AWS pre-sales ?

The certification on AWS Architect (associate or ...READ MORE

answered Nov 30, 2018 in AWS by Aniket
461 views
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer